public static boolean startsWithIgnoreCase ( String input , String prefix ) { if ( input == null || prefix == null || prefix . length ( ) > input . length ( ) ) { return false ; } else { final char [ ] inputCharArray = input . toCharArray ( ) ; final char [ ] prefixCharArray = prefix . toCharArray ( ) ; for ( int i = 0 ; i < prefixCharArray . length ; i ++ ) { if ( ! equalsIgnoreCase ( prefixCharArray [ i ] , inputCharArray [ i ] ) ) { return false ; } } return true ; } }
Tests if this string starts with the specified prefix ignoring case