Here you can find the source of HTMLEncode(String s)
public static String HTMLEncode(String s)
//package com.java2s; /*//from w w w.j av a2 s.c o m * Copyright (C) 2012 Viettel Telecom. All rights reserved. * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ public class Main { private static final String c[] = { "<", ">" }; private static final String expansion[] = { "<", ">" }; public static String HTMLEncode(String s) { for (int j = 0; j < c.length; j++) { s = s.replace(c[j], expansion[j]); } return s; } }