Java HTML Entity unescapeHTMLEntities(String source)

Here you can find the source of unescapeHTMLEntities(String source)

Description

unescape HTML Entities

License

Open Source License

Declaration

public static String unescapeHTMLEntities(String source) 

Method Source Code

//package com.java2s;

import java.util.HashMap;
import java.util.Iterator;

import java.util.Map;

public class Main {
    private final static Map<String, String> htmlEntities = new HashMap<String, String>();

    public static String unescapeHTMLEntities(String source) {
        Iterator<String> it = htmlEntities.keySet().iterator();

        while (it.hasNext()) {

            String key = it.next();
            String val = htmlEntities.get(key);
            source = source.replaceAll(key, val);
        }/*from  w w  w.  j  a v  a  2s .c  om*/
        return source;
    }
}

Related

  1. charToHtmlEntity(char entity)
  2. htmlEntities(String html)
  3. removeHtmlEntity(String content)
  4. replaceHtmlEntitiesWithEmptyString(String stb)