private static boolean validateString(String string){
  return !string.contains("\n");
}

private static boolean validateString ( String string ) { return ! string . contains ( "\n" ) ; }
validate string - return false if contains newlines
