List of utility methods to do String Double Quote
String | doubleQuote(String value) Double quote the given string; double quotes are escaped. return quote(value, '"'); |
String | doubleQuote(String x) double Quote return enclose(x, "\""); |
String | doubleQuoted(String string) double Quoted return "\"" + string.replaceAll("\"", "\\\"") + "\""; |
String | doubleQuotedString(String str) double Quoted String StringBuilder result = new StringBuilder("\""); for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); if (ch == '\n') { result.append("\\n"); continue; if (ch == '\r') { ... |
String | doublequoteEncode(String str) Doubles every " mark in the string. StringBuffer buf = new StringBuffer(str.length()); for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == '"') { buf.append("\"\""); } else { buf.append(str.charAt(i)); return buf.toString(); |
String | doubleQuoteIfNecessary(String string) Returns a double-quoted String if the said String contains white-space. return string != null && string.contains(" ") && !string.startsWith("\"") && !string.endsWith("\"") ? "\"" + string + "\"" : string; |
String | doubleQuoteIfNotNull(String str) double Quote If Not Null return str = (str != null) ? str = "\"" + str + "\"" : null; |
String | doubleQuotes(CharSequence stringToDoubleQuote, boolean escapeDoubleQuote) Double quotes the given string (eg. return "\"" + (escapeDoubleQuote ? escapeDoubleQuote(stringToDoubleQuote) : stringToDoubleQuote) + "\""; |
String | doubleQuotes(final String s) Returns a string with double quotes at the beginning and at the end of the string. if (s == null) { return null; return '"' + s + '"'; |