private static boolean matches ( StringBuilder word , String val ) { int len = word . length ( ) ; if ( len != val . length ( ) ) return false ; // Start at index 1, assuming that the first characters have already // been checked to match. for ( int index = 1 ; index < len ; index ++ ) { char cw = word . charAt ( index ) ; char cv = val . charAt ( index ) ; if ( cw != cv ) { return false ; } } return true ; }
Case sensitive match test .