Unescape Html String - Android java.lang

Android examples for java.lang:String Escape

Description

Unescape Html String

Demo Code

import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.security.SecureRandom;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Locale;

public class Main{


    public static String getHtmlStrCnvr(String srcString) {

        String tmpString = srcString;

        try {//from   ww  w . j a  va 2  s  .com
            tmpString = tmpString.replaceAll("&lt;", "<");
            tmpString = tmpString.replaceAll("&gt;", ">");
            tmpString = tmpString.replaceAll("&amp;", "&");
            tmpString = tmpString.replaceAll("&nbsp;", " ");
            tmpString = tmpString.replaceAll("&apos;", "\'");
            tmpString = tmpString.replaceAll("&quot;", "\"");
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        return tmpString;

    }

}

Related Tutorials