STRING function of the enhancement of object
Related Tags:
/ / String actual length measurement
String.prototype.Tlength = function () (var arr = this.match (/ [^ \ x00-\ xff] / ig); return this.length (arr == null? 0: arr.length);)
/ / String from the left
String.prototype.left = function (num, mode) (if (! / \ D /. Test (num)) return (this); this.substr var str = (0, num); if (! Mode) return str ; var n = str.Tlength () - str.length; num = num - parseInt (n / 2); return this.substr (0, num);)
/ / String from the right
String.prototype.right = function (num, mode) (if (! / \ D /. Test (num)) return (this); var str = this.substr (this.length-num); if (! Mode) return str; var n = str.Tlength () - str.length; num = num - parseInt (n / 2); return this.substr (this.length-num);)
/ / String contains
String.prototype.GetCount = function (str, mode) (return eval ( "this.match (/ (" str ") / g" (mode? "I ":"")"). Length ");)
/ / Empty character string ends removed
String.prototype.Trim = function () (return this.replace (/ (^ \ s *) | (\ s * $) / g ,"");}
String.prototype.Ltrim = function () (return this.replace (/ (^ \ s *) / g, "");}
String.prototype.Rtrim = function () (return this.replace (/ (\ s * $) / g, "");}
</ Script>
- JavaScript [object. Attributes] LIBRARY bis
- JavaScript object-oriented support (2)
- JavaScript Object-Oriented Programming
- Pre-loading and JavaScript Image () object
- Javascript all object attributes access
- JavaScript object-oriented support (1)
- Recordset object explain
- JavaScript write custom object syntax
- JavaScript [object. Attributes] one of the highlights
- STRING function of the enhancement of object
- JS access by dragging the object of ID
- Ajax's Java Object Serialization
- JS-AJAX entry Example: recycling, function, object, object attributes
- JavaScript object attributes explain Application
- Javascript: window object methods
- JavaScript object-oriented support (4)
- JavaScript object-oriented support (6)
- MovieClip on the prototype object
- JavaScript object-oriented support (3)
- Javascirpt Object Format




