1. String.trim() · 2.str.replace(" ", ""); 去掉所有空格,包括首尾、中间 · 3.或者replaceAll(" +",""); 去掉所有空格 · 4.str = .replaceAll("\\s*", "");
確定! 回上一頁