Java String Unescape unEscape(String value)

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

Description

Unescapes the string by replacing some XML entities into plain symbols.

License

Open Source License

Parameter

Parameter Description
value value to unescape.

Return

unescaped content.

Declaration

public static String unEscape(String value) 

Method Source Code

//package com.java2s;
// are made available under the terms of the Eclipse Public License v1.0

public class Main {
    /**/*from   ww  w .j ava2  s .co  m*/
     * Unescapes the string by replacing some XML entities into plain symbols.
     *
     * @param value value to unescape.
     * @return unescaped content.
     */
    public static String unEscape(String value) {
        value = value.replaceAll("&lt;", "<");
        value = value.replaceAll("&gt;", ">");
        value = value.replaceAll("&amp;", "&");
        value = value.replaceAll("&quot;", "\"");
        value = value.replaceAll("&apos;", "'");
        return value;
    }
}

Related

  1. unescape(String theValue)
  2. unescape(String val)
  3. unescape(String val, char quote)
  4. unescape(String value)
  5. unescape(String value)
  6. unescape(String value)
  7. unescape(String value)
  8. unescape(String value)
  9. unescape(String value)