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

intunquote(char[] ca, int pos, StringBuffer out)
unquote
if (ca[pos++] != '"') {
    throw new IllegalArgumentException("Input not a quoted string");
while (ca[pos] != '"') {
    char c = ca[pos++];
    if (c == '\\') {
        switch (ca[pos++]) {
        case '"':
...
CharSequenceunquote(final CharSequence quotePhrase)
Unquote the quote phrase.
if (quotePhrase.length() == 0)
    return quotePhrase;
int length = quotePhrase.length();
if ((quotePhrase.charAt(0) == '"' && quotePhrase.charAt(length - 1) == '"')
        || (quotePhrase.charAt(0) == '\'' && quotePhrase.charAt(length - 1) == '\'')) {
    final StringBuilder builder = new StringBuilder();
    char ch = '\0';
    for (int index = 1; index < length - 1; index++) {
...
Stringunquote(final String aInput)
Removes all double quotes from the given input.
return unquote(aInput, '"');
Stringunquote(final String in)
unquote
String s = in.trim();
int l = s.length();
if (l < 2)
    return in;
char a = s.charAt(0);
char b = s.charAt(l - 1);
if (a != b)
    return in;
...
StringunQuote(final String quoted)
un Quote
final String quoted1 = quoted.trim();
final int len = quoted1.length();
final int start = quoted1.charAt(0) == '"' ? 1 : 0;
final int end = quoted1.charAt(quoted1.length() - 1) == '"' ? len - 1 : len;
return start == 0 && end == len ? quoted : quoted1.substring(start, end);
Stringunquote(final String s)
unquote
final int length = s.length();
if (length > 2 && s.charAt(0) == '\'' && s.charAt(length - 1) == '\'') {
    return s.substring(1, length - 1);
return s;
Stringunquote(final String str)
unquote
return isQuotedString(str) ? str.substring(1, str.length() - 1) : str;
Stringunquote(String _path)
unquote
byte[] path = _path.getBytes();
int pathlen = path.length;
int i = 0;
while (i < pathlen) {
    if (path[i] == '\\') {
        if (i + 1 == pathlen)
            break;
        System.arraycopy(path, i + 1, path, i, path.length - (i + 1));
...
Stringunquote(String argument)
unquote
int length = argument.length();
return argument.substring(0, 1).equals("'") && argument.substring(length - 1, length).equals("'")
        ? argument.substring(1, length - 1)
        : argument;
Stringunquote(String argument)
unquote
if (!argument.startsWith("\"") || !argument.endsWith("\"")) {
    return argument;
return argument.substring(1, argument.length() - 1);