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 aString)
unquote
return aString.substring(1, aString.length() - 1).replace("\\\"", "\"");
Stringunquote(String entityName)
unquote
if (entityName.length() < 2) {
    return entityName;
if (!(entityName.charAt(0) == SINGLE_QUOTE && entityName.charAt(entityName.length() - 1) == SINGLE_QUOTE)) {
    return entityName;
if (entityName.indexOf('\'') == -1) {
    return entityName.substring(1, entityName.length() - 1);
...
Stringunquote(String in)
unquote
if (isEmpty(in))
    return in;
while (in.startsWith("\"") || in.startsWith("'"))
    in = in.substring(1);
while (in.endsWith("\"") || in.endsWith("'"))
    in = in.substring(0, in.length() - 1);
return in;
Stringunquote(String input, char quoteChar)
If the input string starts and ends with quoteChar the starting and ending quoteChar will be removed.
if (input == null) {
    return null;
if (input.length() < 2) {
    return input;
String unquoted = input;
if (isQuoted(input, quoteChar)) {
...
Stringunquote(String literal)
Removes all quotes at the beginning and ending of given string.
String result = "";
if ((literal != null) && (literal.length() > 0)) {
    if (literal.charAt(0) != '\"') {
        if (literal.charAt(0) != '\'') {
            result = literal;
        } else {
            if (literal.trim().length() > 0) {
                result = literal.substring(1, literal.length() - 1);
...
Stringunquote(String maybeQuoted)
Removes single or double quotes which surround a String.
if (maybeQuoted == null || maybeQuoted.length() < 2)
    return maybeQuoted;
boolean isQuoted = false;
int len = maybeQuoted.length();
if (maybeQuoted.charAt(0) == '"' && maybeQuoted.charAt(len - 1) == '"')
    isQuoted = true;
else if (maybeQuoted.charAt(0) == '\'' && maybeQuoted.charAt(len - 1) == '\'')
    isQuoted = true;
...
Stringunquote(String message)
unquote
if (message == null)
    return message;
if (message.length() > 1) {
    if ((message.charAt(0) == '"' && message.charAt(message.length() - 1) == '"')
            || (message.charAt(0) == '\'' && message.charAt(message.length() - 1) == '\''))
        return message.substring(1, message.length() - 1);
return message;
...
Stringunquote(String name)
Removes dollar ($) prefix from the given name if it exists
if (!name.isEmpty() && name.charAt(0) == '$') {
    return name.substring(1);
return name;
Stringunquote(String name)
Return the unquoted version of name (stripping the start and end '`' characters if present).
return isQuoted(name) ? name.substring(1, name.length() - 1) : name;
Stringunquote(String quoted)
unquote
return quoted.replace("\"", "");