Here you can find the source of htmlEncoder(String content)
public static String htmlEncoder(String content)
//package com.java2s; //License from project: Apache License public class Main { public static String htmlEncoder(String content) { content = content.replaceAll("\n", "<br>"); content = content.replaceAll("<", "<"); content = content.replaceAll(">", ">"); content = content.replaceAll(" ", " "); return content; }//from w ww. j a v a 2 s . c om }