Java去掉字符串最后一个字符
字符串:String str = "1,2,3,4,5,"; 目标:去掉最后一个逗号","; 方法:if(str.length() > 1){
str = str.substring(0, str.length() - 1));
}
t.
字符串:String str = "1,2,3,4,5,"; 目标:去掉最后一个逗号","; 方法:if(str.length() > 1){
str = str.substring(0, str.length() - 1));
}