import org.junit.Test;
public class index { @Testpublic void index(){ String str = "how.my are you"; if("".equals(str) || str==null){ System.out.println("没有可用数据"); } else{ String strs[] = str.split("\\s+|[.]"); StringBuffer restr = new StringBuffer(); for(int i = strs.length-1; i >= 0; i--){ System.out.println(strs[i]); restr.append(" "+strs[i]); } System.out.println("反:"+restr); }}
}