public static int indexOfIgnoreCase(int startingPosition,String searchIn,String searchFor){
  if ((searchIn == null) || (searchFor == null)) {
    return -1;
  }
  int searchInLength=searchIn.length();
  int searchForLength=searchFor.length();
  int stopSearchingAt=searchInLength - searchForLength;
  if (startingPosition > stopSearchingAt || searchForLength == 0) {
    return -1;
  }
  char firstCharOfSearchForUc=Character.toUpperCase(searchFor.charAt(0));
  char firstCharOfSearchForLc=Character.toLowerCase(searchFor.charAt(0));
  for (int i=startingPosition; i <= stopSearchingAt; i++) {
    if (isCharAtPosNotEqualIgnoreCase(searchIn,i,firstCharOfSearchForUc,firstCharOfSearchForLc)) {
      while (++i <= stopSearchingAt && (isCharAtPosNotEqualIgnoreCase(searchIn,i,firstCharOfSearchForUc,firstCharOfSearchForLc))) {
      }
    }
    if (i <= stopSearchingAt && startsWithIgnoreCase(searchIn,i,searchFor)) {
      return i;
    }
  }
  return -1;
}

public static int indexOfIgnoreCase ( int startingPosition , String searchIn , String searchFor ) { if ( ( searchIn == null ) || ( searchFor == null ) ) { return - 1 ; } int searchInLength = searchIn . length ( ) ; int searchForLength = searchFor . length ( ) ; int stopSearchingAt = searchInLength - searchForLength ; if ( startingPosition > stopSearchingAt || searchForLength == 0 ) { return - 1 ; } char firstCharOfSearchForUc = Character . toUpperCase ( searchFor . charAt ( 0 ) ) ; char firstCharOfSearchForLc = Character . toLowerCase ( searchFor . charAt ( 0 ) ) ; for ( int i = startingPosition ; i <= stopSearchingAt ; i ++ ) { if ( isCharAtPosNotEqualIgnoreCase ( searchIn , i , firstCharOfSearchForUc , firstCharOfSearchForLc ) ) { while ( ++ i <= stopSearchingAt && ( isCharAtPosNotEqualIgnoreCase ( searchIn , i , firstCharOfSearchForUc , firstCharOfSearchForLc ) ) ) { } } if ( i <= stopSearchingAt && startsWithIgnoreCase ( searchIn , i , searchFor ) ) { return i ; } } return - 1 ; }
finds the position of a substring within a string ignoring case .
