标签:http image img inf oid sys nbsp src 反转
public class ReverseWords { public static String reverseWords(final String original) { String[] array=original.split(" "); if(array.length==0){ return original; } int i=0; for (String string : array){ array[i] = new StringBuilder(string).reverse().toString(); i++; } return String.join(" ",array); } public static void main(String[] args) { System.out.print( ReverseWords.reverseWords("ehT kciuq nworb xof spmuj revo eht yzal .god")); }
输出的结果
标签:http image img inf oid sys nbsp src 反转
原文地址:https://www.cnblogs.com/hkr1997/p/10248826.html