The list of methods to do String Single Quote are organized into topic(s).
String
singleQuote(final String text) Add single quotes ' around the text.
final StringBuilder b = new StringBuilder((text != null ? text.length() : 0) + 2);
b.append(SINGLE_QUOTE);
if (text != null) {
b.append(text);
b.append(SINGLE_QUOTE);
return b.toString();
String
singleQuote(final String value) Enclose the input string in single quotes if not already.
if ((value != null) && !value.isEmpty() && !isQuoted(value, SINGLE_QUOTE)) {
return SINGLE_QUOTE.concat(value).concat(SINGLE_QUOTE);
return value;
String
singleQuote(Object thing) Surrounds given object's Object#toString() with single quotes.
return thing == null ? (String) null
: new StringBuilder().append(SINGLE_QUOTE).append(thing).append(SINGLE_QUOTE).toString();
String
singleQuotedString(String str) single 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
singleQuoteForSql(String val) Encloses a value in single-quotes, to make a SQL string value.
if (val == null) {
return "NULL";
String s0 = replace(val, "'", "''");
return "'" + s0 + "'";