谁最温柔最有派的博客public class SimulateTrim { public static String removeSpace(String str) { String newStr = ""; int start = 0;... //获取首个非空格索引 for (int i = 0; i (); i++) { if (str.charAt(i) != '
景上的博客//模拟trim去掉字符串两端的空格; public class TrimDemo { public static void main(String[] args) { String str = " s "; int start = 0; int end = str.length() - 1; while(start { start++;...