翻转单词序列
翻转单词顺序列
http://www.nowcoder.com/questionTerminal/3194a4f4cf814f63919d0790578d51f3
public class Solution { public String ReverseSentence(String str) { int len=str.length(); if(str==null || len==0)return ""; if(str.indexOf(" ")==-1 ||str.trim().length()==0)return str; String[] temp = str.split(" "); str=""; len=temp.length; while(len-->0){ str= str+" "+temp[len]; } return str.substring(1,str.length()); } }