Here you can find the source of htmlWrap(String text)
public static String htmlWrap(String text)
//package com.java2s; public class Main { private static final char WRAPPING_BREAK = '\n'; private static final String HTML_BREAK = "</br>"; private static final String NBSP = " "; public static String htmlWrap(String text) { String s = text.replaceAll(String.valueOf(WRAPPING_BREAK), HTML_BREAK); return s.replaceAll(" ", NBSP); }//from w w w. j a v a2 s. c o m }