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