Here you can find the source of htmlEscape(String input)
public static String htmlEscape(String input)
//package com.java2s; //License from project: Open Source License public class Main { /**//from www. j a va 2s . c o m * Escape the HTML specific characters (like <) but keeps the UTF-8 content (for characters like é). */ public static String htmlEscape(String input) { if (input == null) { return null; } String result = input.replace("&", "&"); result = result.replace("<", "<"); result = result.replace(">", ">"); result = result.replace("\"", """); return result; } }