一行文字开头的空格替换的正则方法 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/String str = " 酷 流行";System.out.println(str.replaceAll("(?m)(?<=^ *) ", " "));替换结果 酷 流行