0
How to process String words letter by letter?
Sololearn has added a challenge in which it asks to print the words which the user inputs, backwards? For example:- Input :- sick Output :- kcis Input:- name Output:- eman
4 Antworten
0
You can use the string methods charAt(index) or toCharArray().
+ 1
What if you turn the string into a array, and then use a loop to print all array elements, starting from the last element and continue until reach the first one.
//just a thought. Idk anything about Java.
0
Manu_1-9-8-5 if you don't mind can you write a sample code or so I'm a beginner, I don't know where to put that method☹️
0
Alright, with this you can reverse the complete String.
for (int i = s.length() - 1; i > -1; i--)
{
System.out.print(s.charAt(i));
}
Consider that you have to print words in the same order, but backwards. Try it and if you cannot get further ask here again.