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);
}

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
