JS 删除字符串最后一个字符的实现代码

  字符串:string s = "1,2,3,4,5,"

  目标:删除最后一个 ","

  方法:

  用的最多的是substring,这个也是我一直用的

  s=s.substring(0,s.length-1)