JAVA时间字符串去空格、冒号和横杠

String date = "2017-09-19 14:40:01";

String response = date.replaceAll("[[\s-:punct:]]","");

转:https://blog.csdn.net/sswh5123/article/details/78029839

原文地址:https://www.cnblogs.com/xyyou/p/13875182.html