// function name: Trim // Function Description: Space for removing strings // Creation Date: 2004-7-13 15: 30 // Last Modify By: N / A // Last Modify Date: n / astring. Prototype.trim = function () {Return this.Replace (/ (^ / s *) | (/ s * $) / g, "");} // function name: Trim // Function Description: Remove string Space // Creation Date: 2004-7-13 15: 30 // Last Modify by: N / A // Last Modify Date: n / astring.prototype.trim = function () {Return this.Replace (/ ^ / s *) | (/ s * $) / g, "");
// function name: LTRIM / / FUNCTION Description: Space for removing strings // Creation Date: 2004-7-13 9: 58 // Last Modify by: N / A // Last Modify Date: n / astring .prototype.ltrim = function () {Return this.Replace (/ (^ / s *) / g, "");
// function name: RTRIM / / FUNCTION Description: Spaces from the right side of the string // Creation Date: 2004-7-13 15: 31 // Last Modify By: N / A // Last Modify Date: n / astring .prototype.rtrim = function () {Return this.Replace (/ (/ s * $) / g, "");
// function name: len // function description: Returns the actual length of the string, one Chinese word counts 2 lengths // Creation Date: 2004-7-13 9: 58 // Last Modify by: N / A // Last Modify Date: n / astring.prototype.len = function () {var str = this; return str.replace (/ [^ / x00- / xff] / g, "**"). Length}
// function name: isvaliddate // function: Judgment input is a valid short date format - "YYYY-MM-DD" // Creation Date: 2004-7-13 9: 58 // Last Modify By: N / A // Last Modify Date: n / astring.prototype.isvaliddate = function () {var result = this.match (/ ^ (/ D {1, 4}) (- | //) (//) (//) (//) (//) (//) ) / 2 (/ d {1, 2}) $ /); if (result == null) Return False; var D = new date (Result [1], Result [3] -1, Result [4]); Return (D.Getfullyear () == Result [1] && D.getMonth () 1 == Result [3] && d.getdate () == Result [4]);}
// function name: isvalidtime // function description: Judging whether the input is a valid time format - "hh: mm: s" // Creation Date: 2004-7-13 9: 58 // Last Modify BY: N / A / / Last Modify Date: n / astring.prototype.isvalidtime = function () {var resule = this.match (/ ^ (/ d {1, 2}) (:)? (/ D {1, 2}) / 2 (/ d {1, 2}) $ /); if (result == null) Return False; if (Result [1]> 24 || Result [3]> 60 || Result [4]> 60) Return False Return true;} // function name: isvalidemail // function description: Judgment input is an effective email // Creation Date: 2004-7-13 9: 59 // Last Modify by: N / A // Last Modify Date: n / astring.prototype.isvalidemail = function () {var result = this.match (/ ^ / w ((- / w ) | (/./ w )) * / @ [A-ZA-Z0-9 ] (/. | -) [A-ZA-Z0-9] ) * /. [A-ZA-Z0-9] $ /); if (Result == Null) Return False; Return True; }
// function name: isvaliddatetime // function description: Judging whether the input is a valid long-term format - "YYYY-MM-DD HH: MM: SS" // Creation Date: 2004-7-13 9: 59 // Last Modify BY: N / A // Last Modify Date: n / astring.prototype.isvaliddatetime = function () {var result = this.match (/ ^ (/ D {1, 4}) (- | //) (/ D) {1,2}) / 2 (/ d {1, 2}): (/ d {1, 2}): (/ d {1, 2}) $ /); IF (Result == NULL) RETURN FALSE; VAR D = New Date (Result [1], Result [3] -1, Result [4], Result [5], Result [6], Result [7]); RETURN (D.Getfullyear () == Result [1] && (d.getMonth () 1) == Result [3] && D.getdate () == Result [4] && d.GetHours () == Result [5] && D.getminutes () == Result [6] && D.getSeconds () == Result [7]);
// function name: isvalidinteger // function description: Judgment input is an integer // Creation Date: 2004-7-13 10: 01 // Last Modify by: N / A // Last Modify Date: n / astring.prototype .issvalidinteger = function () {var result = this.match (/ ^ (- | / )? / d $ /); if (result == null) Return False; Return True;} // function name: isvalidPositiveInteger / / Function description: Decision input is a positive integer // creation date: 2004-7-13 10: 01 // last modify by: n / a // last modify date: n / astring.prototype.issalidpositivePositiveinteger = function () {var result = this.match (/ ^ / d $ /); if (result == null) Return False; if (Parseint (this)> 0) Return true;}
// function name: isvalidnegativeInteger // function description: Decision input is a negative integer // Creation Date: 2004-7-13 10: 28 // Last Modify By: N / A // Last Modify Date: n / astring. Prototype.issalidnegativeinteger = function () {var result = this.match (/ ^ - / d $ /); if (result == null) Return False; Return True;
// function name: isvalidNumber // function description: Judgment input is a number // Creation date: 2004-7-13 10: 01 // Last Modify by: n / a // last modify date: n / astring.prototype .issavalidnumber = function () {return! isnan (this);}
// function name: isvalidletters // Function Description: Decision input is a string composed of AZ / AZ // Creation Date: 2004-7-13 10: 10 // Last Modify By: N / A // Last Modify Date: n / astring.prototype.isvalidletters = function () {var result = this.match (/ ^ [a-za-z] $ /); if (result == null) Return False; Return True;
// function name: isvaliddigits // Function Description: Decision input is a number composed of 0-9 // Creation Date: 2004-7-13 10: 10 // Last Modify By: N / A // Last Modify Date : N / astring.prototype.isvaliddigits = function () {var result = this.match (/ ^ [1-9] [0-9] $ /); if (result == null) Return False; Return True; } // function name: isvalidalphanumeric // Function Description: Determine whether the input is a string composed of 0-9 / AZ / AZ // Creation Date: 2004-7-13 10: 14 // Last Modify By: N / A // Last Modify Date: n / astring.prototype.isvalidalphanumeric = function () {var result = this.match (/ ^ [a-za-z0-9] $ /); if (Result == Null) Return False;}
// function name: isvalidString // Function Description: Decision input is a string of 0-9 / az / az /. // Creation Date: 2004-7-13 10: 20 // Last Modify By : N / A // last modify date: n / astring.prototype.issAvalidstring = function () {var result = this.match (/ ^ [A-ZA-Z0-9 / s ./-_] " ; if (result == null) return false;}
// function name: isvalidPostalcode // Function Description: Judgment input is a valid Zip code // Creation Date: 2004-7-13 10: 22 // Last Modify by: N / A // Last Modify Date: N / Astring.Prototype.issAlidPostalcode = function () {var result = this.match (/ (^ [0-9] {6} $) /); if (result == null) Return False; Return True;}
// function name: isvalidphono // function description: Judgment input is a valid phone number // Creation Date: 2004-7-13 10: 22 // Last Modify By: N / A // Last Modify Date: N / Astring.Prototype.issAlidPhoneno = function () {var result = this.match (/ (^ [0-9] {3, 4} / - [0-9] {3,8} $) | (^ [0- 9] {3,8} $) | (^ / ([0-9] {3, 4} /) [0-9] {3, 8} $) /); if (Result == Null) Return False Return True;}