let str = '[2024-01-23,2024-12-22]'
let c = str.replace(/\]|\[|\?]/g, '')
console.log(c)
console.log(c.split(','))
JS 正则表达式去除字符串中任意(一个或多个)指定字符
最新推荐文章于 2024-04-09 11:41:40 发布
let str = '[2024-01-23,2024-12-22]'
let c = str.replace(/\]|\[|\?]/g, '')
console.log(c)
console.log(c.split(','))