Problems with empty arrays (Putting
Hi
I've been trying to find a way to put the first character of a string to the end of the string. What I'm doing is the following:
- Create an char array with the single letters in each slot.
- Taking the first character and putting it into the last array number + 1.
- making the first array[0] = null; (and this is where the problem lies)
When I make the array[0] = null and System.out.print(array); it gives me an error because its empty. I also tried doing array[0] = " "; and still gives me the same error.
I don't have the script with me its at school but thats how I'm doing it sorry I can't get the error message.
Is there a way to destrow the first array[0]? so I don't need it, or possibly make a loop that shifts everything over -1? But that seems long a redundant.
Any help is greatly appreciated!