protected boolean canConsumeThisString ( String string , boolean consume ) { if ( string == null ) { return false ; } for ( int i = 0 ; i < string . length ( ) ; i ++ ) { if ( ! input . next ( i ) . is ( string . charAt ( i ) ) ) { return false ; } } if ( consume ) { input . consume ( string . length ( ) ) ; } return true ; }
Checks if the next characters starting from the current match the given string .