code: protected static int indexFirstOf( String s, String delims, int offset )
      {
          if ( s == null || s.length() == 0 )
          {
              return -1;
          }
          if ( delims == null || delims.length() == 0 )
          {
              return -1;
          }
  
          // check boundaries
          if ( offset < 0 )
          {
              offset = 0;
          }
          else if ( offset > s.length() )
          {
              return -1;
          }
  
          // s is never null
          int min = s.length();
          char[] delim = delims.toCharArray();
          for ( int i = 0; i < delim.length; i++ )
          {
              int at = s.indexOf( delim[i], offset );
              if ( at >= 0 && at < min )
              {
                  min = at;
              }
          }
  
          return ( min == s.length() ) ? -1 : min;
      }
docs: Get the earliest index, searching for the first occurrance of
  any one of the given delimiters.
  
  @param s      the string to be indexed
  @param delims the delimiters used to index
  @param offset the from index
  @return the earlier index if there are delimiters