string str = " To be or not be ";
//按空格分割
string[]split = str . split(" ");
//循環反轉每個
字符串over =
for(int I = 0;我& ltsplit .長度;i++) {
//定義StringBuffer並調用反轉方法。
over += new StringBuffer(split[i])。reverse()+" ";
}
//打印結果
system . out . println(over);