public static boolean startsWithIgnoreCase(String s,String prefix){
  final int pl=prefix.length();
  if (s.length() < pl)   return false;
  for (int i=0; i < pl; i++) {
    char sc=s.charAt(i);
    char pc=prefix.charAt(i);
    if (sc != pc) {
      sc=Character.toUpperCase(sc);
      pc=Character.toUpperCase(pc);
      if (sc != pc) {
        sc=Character.toLowerCase(sc);
        pc=Character.toLowerCase(pc);
        if (sc != pc)         return false;
      }
    }
  }
  return true;
}

public static boolean startsWithIgnoreCase ( String s , String prefix ) { final int pl = prefix . length ( ) ; if ( s . length ( ) < pl ) return false ; for ( int i = 0 ; i < pl ; i ++ ) { char sc = s . charAt ( i ) ; char pc = prefix . charAt ( i ) ; if ( sc != pc ) { sc = Character . toUpperCase ( sc ) ; pc = Character . toUpperCase ( pc ) ; if ( sc != pc ) { sc = Character . toLowerCase ( sc ) ; pc = Character . toLowerCase ( pc ) ; if ( sc != pc ) return false ; } } } return true ; }
returns true iff s starts with prefix , ignoring case .
