\ 标记向后引用 \s 空格 - 横杠 :punct: 任何标点符号
String localDate= LocalDate.now().toString().replaceAll("[[\\s-:punct:]]",""); System.out.println(localDate);