Java Utililty Methods HTML Sanitize

List of utility methods to do HTML Sanitize

Description

The list of methods to do HTML Sanitize are organized into topic(s).

Method

Stringsanitize(String html)
sanitize
if (html == null || html.isEmpty()) {
    return html;
for (int i = 0; i < sanitizeSrc.length; i++) {
    html = html.replace(sanitizeSrc[i], sanitizeDesc[i]);
return html;
StringsanitizeForHtmlTag(String string)
Escapes HTML tag safely.
if (string == null) {
    return null;
return string.replace("<", "&lt;").replace(">", "&gt;");
StringsanitizeQuot(String html)
sanitize Quot
if (html == null || html.isEmpty()) {
    return html;
return html.replace("\"", "&quot;");