可以使用如下的正規表示式把上列字串中的空白字元去掉: String newString = oldString.replaceAll("\\s+", ""); System.out.println(newString);
確定! 回上一頁