public static boolean isEnclosedBetween ( final String input , final String leftEncloser , String rightEncloser ) { if ( input == null ) { throw new IllegalArgumentException ( "input can't be null" ) ; } if ( leftEncloser == null ) { throw new IllegalArgumentException ( "leftEncloser can't be null" ) ; } if ( rightEncloser == null ) { throw new IllegalArgumentException ( "rightEncloser can't be null" ) ; } return input . startsWith ( leftEncloser ) && input . endsWith ( rightEncloser ) ; }
Verifies whether String is enclosed by encloser