var str =“aaa,bbb”
//截取","之前字符串
var str1=str.substring(0, str.indexOf(","));
console.log(str1) //aaa
//截取","之后字符串
vra str2=str.substring(str1.length+1, str.length);
console.log(str2) //bbb
var str =“aaa,bbb”
//截取","之前字符串
var str1=str.substring(0, str.indexOf(","));
console.log(str1) //aaa
//截取","之后字符串
vra str2=str.substring(str1.length+1, str.length);
console.log(str2) //bbb