public boolean isValid(String text){
  for (int i=0; i < text.length(); ++i) {
    char ch=text.charAt(i);
    if (ch == '\u00A7' || ch == '\n')     continue;
    if (chars.get(ch) == null)     return false;
  }
  return true;
}

public boolean isValid ( String text ) { for ( int i = 0 ; i < text . length ( ) ; ++ i ) { char ch = text . charAt ( i ) ; if ( ch == '§' || ch == '\n' ) continue ; if ( chars . get ( ch ) == null ) return false ; } return true ; }
check whether the given text is valid .
