Android XML String Unescape unescape(String text)

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

Description

Unescaping some chars and symbols

Parameter

Parameter Description
text to unescape

Return

unescaped string

Declaration

public static String unescape(String text) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from   www . j a v a2  s  . c o m
     * Unescaping some chars and symbols
     * @param text to unescape
     * @return unescaped string
     */
    public static String unescape(String text) {
        return text.replace("&", "&").replace(""", "\"")
                .replace("<br>", "\n").replace("&gt;", ">")
                .replace("&lt;", "<").replace("&#39;", "'")
                .replace("<br/>", "\n").replace("&ndash;", "-")
                .replace("&#33;", "!").trim();
    }
}

Related

  1. unescape(String source)
  2. unescapeXML(final String xml)
  3. urlEscape(String s)
  4. replaceEscape(String result)
  5. replaceEscapeSequence(String input)