私はString str="Ram Is A Good Boy";
出力が欲しい
ボーイグッドAはラムです
このアプローチのコードを教えてください。
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 [] strArray = str.split(" ");
StringBuilder sb = new StringBuilder();
for(int i=strArray.length-1;i>-1;i--)
{
sb.append(strArray[i]+" ");
}
System.out.println(sb.toString());
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);