I need help for another one of my assignments for CS Class.
On the rubric, one of the part said:
all characters are shifted right by two positions and the last two characters becomes the first two characters
The condition is that the string has to be entered by the user.
So, for example, if the user enters the string " Beginning",
I have to do this :
Beginning -> Beginni ng
I partially understand this and I manage to move the letter by doing this:
char firstchar = input.charAt(input.length()); char secondchar = input.charAt ((input.length())-1); System.out.print (firstchar); System.out.print(secondchar); System.out.print (input);
Problem whith what I did is that it prints :
What I want to do is remove "ng" from gnBeggining
How should I do that?
Thanks in advance.