src/org/nutz/lang/Strings.java
public static String removeLast(String str, char c) {
        return (Strings.isEmpty(str) || !str.endsWith(c + "")) ? str
                                                               : str.subSequence(0,
                                                                                 str.length() - 1)
                                                                    .toString();
    }
public static String removeLast(String str, char c) {
        return (Strings.isEmpty(str) || !str.endsWith(c + "")) ? str
                                                               : str.subSequence(0,
                                                                                 str.length() - 1)
                                                                    .toString();
    }
如果str中最后一个字符和 c一致,则删除,否则返回 str
<p>
比如:
<ul>
<li>removeLast("12345",5) => "12345"
<li>removeLast("ABC",'B') => "ABC"
<li>removeLast("A",'B') => "A"
<li>removeLast("A",'A') => ""
</ul>

@param str
字符串
@param c
最后一个个要被截取的字符
@return 新字符串