Here you can find the source of toHtmlVerticalString(final String source)
public static String toHtmlVerticalString(final String source)
//package com.java2s; //License from project: Apache License public class Main { public static String toHtmlVerticalString(final String source) { if ((source == null) || (source.trim().length() == 0)) { return source; }// ww w . ja v a2 s . c om final String tmp = source.trim(); final int len = tmp.length(); final StringBuffer result = new StringBuffer(); for (int i = 0; i < (len - 1); i++) { result.append(tmp.charAt(i)).append("<br>"); } result.append(tmp.charAt(len - 1)); return result.toString(); } /** * To string. * * @param obj the obj * @return the string */ public static String toString(final Object obj) { if (obj == null) { return ""; } else { return obj.toString(); } } }