字符串:String str = "1,2,3,4,5,";
目标:去掉最后一个逗号",";
方法:str = str.substring(0, str.length() - 1));
参考博客:
java删除字符串最后一个字符的几种方法 - Faron - 博客园
https://www.cnblogs.com/printN/p/6742054.html