public static String quote(String s){
  if (s == null)   return null;
  if (s.length() == 0)   return "\"\"";
  StringBuffer b=new StringBuffer(s.length() + 8);
  quote(b,s);
  return b.toString();
}

public static String quote ( String s ) { if ( s == null ) return null ; if ( s . length ( ) == 0 ) return "\"\"" ; StringBuffer b = new StringBuffer ( s . length ( ) + 8 ) ; quote ( b , s ) ; return b . toString ( ) ; }
quote a string . the string is quoted only if quoting is required due to embeded delimiters , quote characters or the empty string .
