public static String quote(String input){
  if (input.contains(" ")) {
    return "\"" + input + "\"";
  }
 else {
    return input;
  }
}

public static String quote ( String input ) { if ( input . contains ( " " ) ) { return "\"" + input + "\"" ; } else { return input ; } }
quotes the given input string iff it contains whitespace .
