public static boolean isCharAtEqual(String string,int index,char charToCompare){
  if ((index < 0) || (index >= string.length())) {
    return false;
  }
  return string.charAt(index) == charToCompare;
}

public static boolean isCharAtEqual ( String string , int index , char charToCompare ) { if ( ( index < 0 ) || ( index >= string . length ( ) ) ) { return false ; } return string . charAt ( index ) == charToCompare ; }
safely compares provided char with char on given location .
