cdm/src/main/java/ucar/unidata/util/StringUtil2.java
static public String remove(String s, String sub) {
    int len = sub.length();
    int pos;
    while (0 <= (pos = s.indexOf(sub))) {
      s = s.substring(0, pos) + s.substring(pos + len);
    }
    return s;
  }
static public String remove(String s, String sub) {
    int len = sub.length();
    int pos;
    while (0 <= (pos = s.indexOf(sub))) {
      s = s.substring(0, pos) + s.substring(pos + len);
    }
    return s;
  }
Remove all occurrences of the substring sub in the string s.

@param s   operate on this string
@param sub remove all occurrences of this substring.
@return result with substrings removed