字符串
var basic = "abc,def,ghi,";
第一种
basic = basic.substr(0, basic.length - 1);
第二种
basic = basic.substring(0, basic.length - 1);
第三种
basic = basic.substring(0, basic.lastIndexOf(‘,‘));
原文地址:https://www.cnblogs.com/dianzan/p/8989938.html
时间: 2024-11-09 09:26:43