怎么把20161011转化为2016-10-11String time = "20161011";怎么转换成:String time1 = "2016-10-11";
1 回答
蛊毒传说
TA贡献1895条经验 获得超3个赞
String x = "20161111";
System.out.println(x.replaceAll("(\\d{4})(\\d{2})(\\d{2})", "$1-$2-$3"));
添加回答
举报
0/150
提交
取消