Java Hash String hasHTMLTag(String text)

Here you can find the source of hasHTMLTag(String text)

Description

Returns true if the input string contains any escape character The escaped characters are : < > " ' \ &

License

BSD License

Parameter

Parameter Description
text input text to be checked

Return

hasEscape character

Declaration

public static boolean hasHTMLTag(String text) 

Method Source Code

//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;
    }
}

Related

  1. hashString(String str)
  2. hashString(String str)
  3. hashTermToString(int i, int h)
  4. hasHtmlTag(String content)
  5. hasHTMLTag(String html)
  6. hashToHexString(byte[] hash)
  7. hashToString(byte hash[])
  8. hasHttp(String url)