I have a String str="Ram Is A Good Boy";
I want the output
Boy Good A Is Ram
Please give me a code for this approach??
I have a String str="Ram Is A Good Boy";
I want the output
Boy Good A Is Ram
Please give me a code for this approach??
Not giving the direct solution but if you follow the steps below, you'll achieve what you want.
But on second thought your mirror image is wrong.
Ram Is A Good Boy | yoB dooG A sI maR
isn't that correct mirror for the given string?
String str="Ram Is A Good Boy";
String splits[] = str.split(" ");
string reverse = "";
for(int i = splits.length-1; i>=0; i--) {
reverse += splits[i] + " ";
}
System.out.println(reverse);