The list of methods to do String Double Quote are organized into topic(s).
String
doubleQuote(Object thing) Surrounds given object's Object#toString() with double quotes.
return thing == null ? (String) null
: new StringBuilder().append(DOUBLE_QUOTE).append(thing).append(DOUBLE_QUOTE).toString();
String
doubleQuote(String s) Place double quotes arround input string, Escape single quotes that will cause problems.
if (s == null)
return "NULL";
StringBuilder sb = new StringBuilder();
sb.append('"');
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if (ch == '\'')
sb.append("\\'");
...
String
doubleQuote(String str) double Quote
int pos = str.indexOf('\'');
if (pos != -1) {
str = str.substring(0, pos + 1) + "'" + doubleQuote(str.substring(pos + 1));
return str;