code: public static String trim(String value, String toTrim) {
          int len = toTrim.length();
          while (value.startsWith(toTrim)) {
              value = value.substring(len);
          }
          while (value.endsWith(toTrim)) {
              value = value.substring(0, value.length() - len);
          }
          return value;
      }
docs: Trims the given string from the given value
  
  @param value  The value to be trimmed
  @param toTrim The string to trim
  @return The value with any occurrences of toTrim removed from the start and end of the value