Java String Unescape unescape(String value)

Here you can find the source of unescape(String value)

Description

Reverse the escaping of the control characters to get the original string.

License

LGPL

Parameter

Parameter Description
value escaped string

Return

original string

Declaration

public static String unescape(String value) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    /**// w  ww . jav a  2 s .com
     * Reverse the escaping of the control characters to get the original string.
     * @param value escaped string
     * @return original string
     */
    public static String unescape(String value) {
        if (value == null) {
            return value;
        }
        if (value.length() == 0) {
            return value;
        }
        return value.replace("&gt;", ">").replaceAll("&lt;", "<").replaceAll("&amp;", "&");
    }
}

Related

  1. unescape(String value)
  2. unescape(String value)
  3. unEscape(String value)
  4. unescape(String value)
  5. unescape(String value)
  6. unescape(String value)
  7. unescape(String value)
  8. unescape(String x)
  9. unescape(StringBuilder escapedText, int index)