Java Utililty Methods String Quote Unescape

List of utility methods to do String Quote Unescape

Description

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

Method

StringunescapeQuotes(String text)
unescape Quotes
return text.replaceAll("\\\\" + QUOTE, QUOTE);
StringunescapeQuotes(String value)
unescape Quotes
if (value.startsWith("\"") && value.endsWith("\"")) {
    return value.substring(1, value.length() - 1);
return value;
StringunescapeQuotesAndBackSlash(String path, boolean isSingleQuoteUnescape)
This method un escapes backslash, double quotes and single quotes (keeping replacement of \\\\\' to ' as is so as to maintain backward compatibility any serialization/deserialization)
path = (isSingleQuoteUnescape) ? path.replace("\\\"", "\"").replace("\\\\\'", "'")
        : path.replace("\\\\\"", "\"").replace("\\\'", "'");
return path.replace("\\\\", "\\");
StringunescapeQuotesWithBackslash(final String value)
unescape Quotes With Backslash
return value.replaceAll("\\\\\"", "\\\"");
StringunescapeSingleQuoteAndBackslash(String str)
unescape Single Quote And Backslash
char[] chars = str.toCharArray();
StringBuffer result = new StringBuffer();
for (int i = 0; i < chars.length; i++) {
    char b = chars[i];
    switch (b) {
    case '\\':
        switch (chars[++i]) {
        case '\\':
...