string str = "a,b,c,";int length = str.length; //获取字符串长度str = str.substring(0,length-1); //截取除最后一位的前面所有字符