问题遇到的现象和发生背景
时间字符串:"20211118213035"
目标时间字符串:"2021-11-18 21:30:35"
尝试用过死方法:如下
"20211118213035".replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/, '$1-$2-$3 $4:$5:$6')
求个优雅一点。
时间字符串:"20211118213035"
目标时间字符串:"2021-11-18 21:30:35"
尝试用过死方法:如下
"20211118213035".replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/, '$1-$2-$3 $4:$5:$6')
求个优雅一点。