private static boolean checkOffset(String value,int offset,char expected){
  return (offset < value.length()) && (value.charAt(offset) == expected);
}

private static boolean checkOffset ( String value , int offset , char expected ) { return ( offset < value . length ( ) ) && ( value . charAt ( offset ) == expected ) ; }
check if the expected character exist at the given offset in the value .
