code: public static int findFirstOf (String container, String chars, int begin){        
          int minIdx = -1;        
          for (int i = 0; i < chars.length() && i >= 0; ++i){
              int idx = container.indexOf(chars.charAt(i), begin);            
              if ( (idx < minIdx && idx != -1) || minIdx == -1){                    
                      minIdx = idx;
              }
          }
          return minIdx;
      }
docs: Find the first occurrence .
  
  @param container the string on which we search
  @param chars the string which we search for the occurrence
  @param begin the start position to search from
  @return the position where chars first occur in the container