JS 把字符串按照逗号分隔成数组,但是里边有中文逗号,怎么办;
解决方法很简单,就是先把中文逗号转为英文逗号;
var str = "12,121,21";
str =str.replace(/[\uff0c]/g, ",");
const list= str.split(",");
[12,121,21]
JS 把字符串按照逗号分隔成数组,但是里边有中文逗号,怎么办;
解决方法很简单,就是先把中文逗号转为英文逗号;
var str = "12,121,21";
str =str.replace(/[\uff0c]/g, ",");
const list= str.split(",");
[12,121,21]