code: public static String getChomp(String str, String sep) {
        int idx = str.lastIndexOf(sep);
        if (idx == str.length() - sep.length()) {
            return sep;
        } else if (idx != -1) {
            return str.substring(idx);
        } else {
            return EMPTY;
        }
    }
docs: <p>Remove everything and return the last value of a supplied String, and
  everything after it from a String.</p>
  
  @param str  the String to chomp from, must not be null
  @param sep  the String to chomp, must not be null
  @return String chomped
  @throws NullPointerException if str or sep is <code>null</code>
  @deprecated Use {@link #substringAfterLast(String, String)} instead
  (although this doesn't include the separator)
  Method will be removed in Commons Lang 3.0.