Java Utililty Methods String Quote

List of utility methods to do String Quote

Description

The list of methods to do String Quote are organized into topic(s).

Method

Stringquote(String s, String specials, char quoteChar)
quote
return quote(s, specials, quoteChar, 0);
Stringquote(String str)
Escape data to protected against SQL Injection
if (str == null) {
    return "NULL";
return "'" + mysql_real_escape_string(str) + "'";
Stringquote(String str)
quote
return quote(str, defaultQuotationSymbol);
Stringquote(String str)
quote
StringBuffer result = new StringBuffer("\"");
for (int i = 0; i < str.length(); i++) {
    char c;
    switch (c = str.charAt(i)) {
    case '\0':
        result.append("\\0");
        break;
    case '\t':
...
Stringquote(String str)
quote
return quote(str, true);
Stringquote(String str)
quote
String escaped = str.replaceAll("[\\\\\"]", "\\\\$0");
return "\"" + escaped + "\"";
Stringquote(String str)
Returns the given string enclosed with quotation marks.
return '"' + str.toString() + '"';
Stringquote(String str)
This is the static method, that quotes a string.
StringBuffer result = new StringBuffer("\"");
for (int i = 0; i < str.length(); i++) {
    char c;
    switch (c = str.charAt(i)) {
    case '\0':
        result.append("\\0");
        break;
    case '\\':
...
Stringquote(String str)
Quote the given String with single quotes.
return (str != null ? "'" + str + "'" : null);
Stringquote(String str)
Quotifies a specified string.
int len = str.length();
StringBuffer buf = new StringBuffer(len + 2);
buf.append("\"");
char c;
for (int i = 0; i < len; i++) {
    c = str.charAt(i);
    if (c == '"' || c == '\\') {
        buf.append("\\");
...