Java Utililty Methods String Unquote

List of utility methods to do String Unquote

Description

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

Method

Stringunquote(String value)
unquote
if (value == null || value.length() < 2) {
    return value;
if (value.charAt(0) == '"' && value.charAt(value.length() - 1) == '"') {
    return value.substring(1, value.length() - 1);
return value;
StringUnQuote(String value)
Un Quote
return value.replaceAll(QUOTE, EMPTY);
Stringunquote(String value)
Given a string, which is quoted with double quotes, returns the contents, without the double quotes.
if (value.startsWith("\'") && (value.endsWith("\'"))) {
    return value.substring(1, value.length() - 1).replaceAll("\\\'", "'");
return value;
Stringunquote(String value)
unquote
if (value.startsWith("\"") && value.endsWith("\"")) {
    return pinch(value, 1);
} else if (value.startsWith("'") && value.endsWith("'")) {
    return pinch(value, 1);
} else {
    return value;
Stringunquote(String value)
unquote
String toReturn = value;
if (toReturn != null) {
    int startAt = 0;
    int endAt = value.length();
    if (toReturn.startsWith("\"") || toReturn.startsWith("'")) {
        startAt = 1;
    if (toReturn.endsWith("\"") || toReturn.endsWith("'")) {
...
StringunquoteAtom(String atom)
Unquote atom (replace ' at the start and end).
atom = atom.trim();
if (atom.length() == 0 || atom.charAt(0) != '\'') {
    return atom;
atom = atom.substring(1, atom.length() - 1);
StringBuffer sb = new StringBuffer();
for (int i = 0; i < atom.length(); i++) {
    char c = atom.charAt(i);
...
StringunquoteCharacterLiteral(String charLiteralStr)
unquote Character Literal
if (charLiteralStr != null && charLiteralStr.length() >= 3 && charLiteralStr.charAt(0) == '\''
        && charLiteralStr.charAt(charLiteralStr.length() - 1) == '\'') {
    return charLiteralStr.substring(1, charLiteralStr.length() - 1);
} else {
    return charLiteralStr;
StringunquoteCString(String str)
Unescape the textual representation of a string specific to SDF and Maude.
return unquoteCString(str, '"');
StringunquotedCharLiteral(char c)
unquoted Char Literal
switch (c) {
case '\b':
    return "\\b";
case '\t':
    return "\\t";
case '\n':
    return "\\n";
case '\f':
...
StringunquotedString(String str)
unquoted String
return trim(str, "\"");