Java Utililty Methods String Unescape

List of utility methods to do String Unescape

Description

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

Method

CharSequenceunescape(final CharSequence target)
unescape
final StringBuilder buff = builder();
final int len = target.length();
for (int i = 0; i < len; i++) {
    final char ch = target.charAt(i);
    if (ch == '#') {
        i++;
        buff.append(target.charAt(i));
    } else {
...
Stringunescape(final String aSpecification)
Unescapes the interface string: replaces '%2F' by slashes '/'
return aSpecification.replaceAll("%2F", "/");
Stringunescape(final String input)
unescape
if (input == null) {
    return input;
return input.replace("\\t", "\t").replace("\\n", "\n").replace("\\r", "\r");
Stringunescape(final String name)
Reverts modifications of #escape(String) such that for all String s t , t.equals(unescape(escape(t))) .
if (name == null) {
    throw new IllegalArgumentException();
StringBuilder buffer = new StringBuilder(name.length());
String str = name;
int i = str.indexOf(escapeChar);
while (i > -1 && i + 2 < str.length()) {
    buffer.append(str.toCharArray(), 0, i);
...
Stringunescape(final String s)
unescape
char ch;
final StringBuilder sb = new StringBuilder();
final StringBuilder sb2 = new StringBuilder();
int ii;
int i;
for (i = 0; i < s.length(); i++) {
    ch = s.charAt(i);
    switch (ch) {
...
Stringunescape(final String source)
unescape
if (source == null) {
    return null;
String result = source;
result = result.replaceAll("&amp;", "&");
result = result.replaceAll("&quot;", "\"");
result = result.replaceAll("&#039;", "\'");
result = result.replaceAll("&lt;", "<");
...
Stringunescape(final String str, final char escapeChar)
Unescapes characters in a escaped string.
final StringBuilder builder = new StringBuilder(str.length());
unescape(str, escapeChar, builder);
return builder.toString();
Stringunescape(final String string, final char quoteChar)
Unescapes specified quote character.
final StringBuilder sbString = new StringBuilder(string.length());
boolean escaped = false;
for (int i = 0; i < string.length(); i++) {
    final char chr = string.charAt(i);
    if (chr == '\\') {
        if (i + 1 < string.length() && string.charAt(i + 1) == quoteChar) {
            i++;
            sbString.append(quoteChar);
...
Stringunescape(final String text)
unescape
StringBuilder result = new StringBuilder(text.length());
int i = 0;
int n = text.length();
while (i < n) {
    char charAt = text.charAt(i);
    if (charAt != '&') {
        result.append(charAt);
        i++;
...
String[]unescape(final String[] inval, final Character escapeChar)
Unescape an array of Strings.
if (inval != null && escapeChar != null && inval.length != 0) {
    for (int i = 0; i < inval.length; i++) {
        inval[i] = unescape(inval[i], escapeChar);
return inval;