Some tool functions previously written when writing JSP websites.

Source: Internet
Author: User

When I was a beginner at JSP, I wrote some tool functions because I could not use the regular expressions in JAVA! Let everyone criticize and give some comments! There are a few functions that you don't want to write! I'm a newbie. I'm afraid of anyone who can't face it ..
Package mxzc. web. strctrl;
Public class StringCtrl
{/************************************** ******
Public synchronized String HTMLcode (String TXTcode) function: Text Replacement
Public synchronized String Unhtmlcode (String str) function: (incomplete) anti-text replacement
Public synchronized String Unhtmlcodea (String str) function: Anti-text replacement
Public synchronized boolean emailcheck (String email) function: checks whether a String conforms to E-Mail.
Public synchronized boolean isemailstr (String email) function: checks whether a String conforms to e-mail.
Public synchronized boolean isqqstr (String qq) function: checks whether a String conforms to QQ
Public synchronized boolean isnumstr (String num) function: checks whether a String is a numeric String.
Public synchronized String userstrlow (String user) function: replace invalid parts of the user name
Public synchronized boolean userstrchk (String user) function: checks whether the String complies with the username rules.
Public synchronized boolean istelstr (String tel) function: Check whether the String is TEL
Public synchronized boolean urlcheck (String url) function: checks whether the String is a URL.
Public synchronized String isotogbk (String iso) function: converts ISO9006-1 code to GBK
Public synchronized String gbktoiso (String gbk) function: GBK code conversion to ISO9006-1
Public synchronized String dostrcut (String oldstr, int length) function: line feed by Chinese character length (half word length for English)
Public synchronized String inttodateshow (int datenum) function: convert the number of seconds from January 1, 1900 to the time String to the date String.
Public synchronized String nowdateshow () function: displays the current date
Public synchronized java. util. Date inttodate (int datenum) function: converts seconds to dates
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.