使用逗号拼接字符串后去掉最后的逗号

112 阅读1分钟

我个人是这样做的 只是个记录

const reg = /,$/gi
let str = '123,234,345,'
str.replace(reg, '')