Here you can find the source of hasHTMLTag(String text)
Parameter | Description |
---|---|
text | input text to be checked |
public static boolean hasHTMLTag(String text)
//package com.java2s; //License from project: BSD License public class Main { /**/*from ww w . j ava 2 s. co m*/ * Returns true if the input string contains any escape character * The escaped characters are : * < > " ' \ & * @param text input text to be checked * @return hasEscape character */ public static boolean hasHTMLTag(String text) { if (text.indexOf('<') >= 0) { return true; } if (text.indexOf('>') >= 0) { return true; } if (text.indexOf('\"') >= 0) { return true; } if (text.indexOf('\\') >= 0) { return true; } if (text.indexOf('&') >= 0) { return true; } return false; } }