Here you can find the source of hasHTMLTag(String html)
public static boolean hasHTMLTag(String html)
//package com.java2s; //License from project: Apache License public class Main { public static boolean hasHTMLTag(String html) { boolean flag = false; if (html != null && html.length() > 0) { for (int i = 0; i <= html.length() - 1; ++i) { char c = html.charAt(i); switch (c) { case '\"': flag = true;// w w w. jav a 2s . c o m break; case '&': flag = true; break; case '<': flag = true; break; case '>': flag = true; } if (flag) { break; } } } return flag; } }