str.replace(str.length() - 1, str.length(), ""); 转载于:https://www.cnblogs.com/leirenyuan/p/11090500.html