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