字符串去了最后一个字符

var str="1,2,3,4,5,";
var newstr=str.substring(0,str.length-1);
alert(newstr);
原文地址:https://www.cnblogs.com/yjhua/p/5092377.html