例如:
oT eb ro ton ot eb
反转后变为: To be or not to be
public class Reverse {
public static StringBuffer start(String data) {
StringBuffer ans = new StringBuffer();
/********** Begin *********/
String[] a=data.split(" ");
for (int i = 0; i < a.length; i++) {
StringBuffer stringBuffer = new StringBuffer(a[i]);
ans.append(stringBuffer.reverse());
ans.append(" ");
}
/********** End *********/
return ans;
}
}