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

Stringunescape(String str)
unescape
StringBuilder outBuffer = new StringBuilder(str.length());
for (int index = 0; index < str.length();) {
    char c = str.charAt(index++);
    if (c == '\\') {
        c = str.charAt(index++);
        if (c == 't') {
            c = '\t';
        } else if (c == 'r') {
...
Stringunescape(String str)
unescape
StringBuilder sb = new StringBuilder();
String[] codeStrs = str.split("\\\\u");
for (String codeStr : codeStrs) {
    if (codeStr.isEmpty()) {
        continue;
    try {
        if (codeStr.length() <= 4) {
...
Stringunescape(String str)
Unescapes the given XML string.
if (str == null || str.length() == 0)
    return ""; 
StringBuffer sb = new StringBuffer();
int len = str.length();
for (int i = 0; i < len; i++) {
    char ch = str.charAt(i);
    switch (ch) {
    case '&':
...
Stringunescape(String str)
unescape
StringBuilder sb = new StringBuilder();
boolean inEscape = false;
for (int i = 0; i < str.length(); ++i) {
    if (inEscape) {
        inEscape = false;
        sb.append(str.charAt(i));
    } else {
        if (str.charAt(i) == '\\') {
...
Stringunescape(String str)
unescape
if (str == null) {
    return null;
StringBuilder unescapedString = new StringBuilder();
char[] charArray = str.toCharArray();
for (int i = 0; i < charArray.length; i++) {
    char c = charArray[i];
    switch (c) {
...
Stringunescape(String str)
unescape
if (str == null) {
    return str;
String temp = str, sub;
temp = "";
char ch = ' ';
int index = str.indexOf("%u");
while (index >= 0) {
...
Stringunescape(String str)
unescape
StringBuffer sb = new StringBuffer(str.length());
char[] array = str.toCharArray();
for (int cnt = 0; cnt < array.length; cnt++) {
    if (array[cnt] != '\\') {
        sb.append(array[cnt]);
    } else {
        switch (array[++cnt]) {
        case 'n':
...
Stringunescape(String str)
Unescapes string, that can be used in .ini file
StringBuilder b = new StringBuilder(str.length());
int i = 0;
int l = str.length();
while (l > 0) {
    char c = str.charAt(i);
    if (c == '+') {
        b.append(' ');
        i++;
...
Stringunescape(String str)
Unescapes the given string and returns the result.
return unescape(str, DEFAULT_ESCAPECHAR);
Stringunescape(String str)
Unescape special characters in literal by removing excess backslashes.
return unescape(str, false);