var reg=/,$/gi;
var warningPhones = $("#warningPhones").val().replace(/\n/g,',');
var warningPhones_str = warningPhones.replace(reg,"");
js 将换行符转换为逗号并去掉尾部逗号
最新推荐文章于 2022-12-12 18:46:16 发布
var reg=/,$/gi;
var warningPhones = $("#warningPhones").val().replace(/\n/g,',');
var warningPhones_str = warningPhones.replace(reg,"");