Here you can find the source of htmlCode(char tok)
public static String htmlCode(char tok)
//package com.java2s; //License from project: Open Source License public class Main { private static final String[][] HTML = { { "<", "<" }, { ">", ">" }, { " ", " " }, { "\n", "<br/>" } }; public static String htmlCode(char tok) { int i = 0; for (; i < HTML.length; i++) { if (HTML[i][0].equals(tok + "")) { return HTML[i][1]; }//ww w . j av a2s . co m } return tok + ""; } }