docs: public static String trim(String string, char garbage)
    {
      if(string == null) {
        return null;
      }
      int length = string.length();
      char prefix = garbage, suffix;
      switch(prefix) {
      case '(':
        suffix = ')';
        break;
      case '[':
        suffix = ']';
        break;
      case '{':
        suffix = '}';
        break;
      case '<':
        suffix = '>';
        break;
      default:
        suffix = prefix;
      }
  
      int beginIndex = 0;
      for(; beginIndex < length; ++beginIndex) {
        if(string.charAt(beginIndex) != prefix) break;
      }
      if(beginIndex == length) {
        return "";
      }
      int endIndex = length - 1;
      for(; endIndex >= 0; --endIndex) {
        if(string.charAt(endIndex) != suffix) break;
      }
      return string.substring(beginIndex, endIndex + 1);
    }