com.ckjava.utils.HTMLUtils Maven / Gradle / Ivy
package com.ckjava.utils;
public class HTMLUtils {
public static String htmlEscape(String htmlstr) {
if (StringUtils.isEmpty(htmlstr)) {
return htmlstr;
}
htmlstr = htmlstr.replace("'", "´");
htmlstr = htmlstr.replace("\"", """);
htmlstr = htmlstr.replace("&", "&");
htmlstr = htmlstr.replace("<", "<");
htmlstr = htmlstr.replace(">", ">");
return htmlstr;
}
public static String parseHtml(String str) {
if (StringUtils.isEmpty(str)) {
return str;
}
str = str.replace("´", "'");
str = str.replace(""", "\"");
str = str.replace("&", "&");
str = str.replace("<", "<");
str = str.replace(">", ">");
return str;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy