日期:2014-05-20 浏览次数:20733 次
public static String revert3(String str, char marker){
String temp = String.valueOf(marker);
String[] strs = str.split(temp);
StringBuffer sb = new StringBuffer();
for(int i=strs.length-1;i>-1;i--){
if(i == 0){
sb.append(strs[i]);
}else{
sb.append(strs[i]+" ");
}
}
return sb.toString();
}
int j = 0;
return ((j = str.lastIndexOf(marker)) == -1) ? str : str
.substring(j + 1,
str.length())
+ " "
+ revert2(
str.substring(0, j),
marker).trim();