STRING function of the enhancement of object

Related Tags:

<script>
  / / 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> 

Related articles:

Please cautiously uses Ajax request to detect non-existent resources
  Please cautiously uses Ajax request to detect non-existent resources    Reply    You do not know there are several recall Apress "Foundations.of.Ajax" in the description of the pattern HEAD request?    Yes, you can use a XHR you do not know what to ...
Csdn Blog template CSS code (1): My Heart is Flying
  Csdn blog is a quality blog, but I believe that good UI more attractive reading --------------------- 0    Effect of the Royal Glance: click to enlarge    Rejuvenate steps:    (1) to enter csdn blog management background, open configuration options, in the di...
Li marked with the CSS style control
  List-style-type version: CSS1/CSS2 compatible ***: IE4 + + inherited NS4 ***:    Syntax:    List-style-type: disc | circle | square | decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | none | armenian | cjk-ideographic | georgian | lower-greek | hebrew | ...
Div prevent forms or by shoring CSS, to support firefox, to be a reminder
  (Table    Table-layout: fixed;    Word-wrap: break-word;    )    (Div    Word-wrap: break-word;    )  ...
Wangzhuan 315 eyes that see through the crook company
  According to incomplete statistics, in the crook Wangzhuan company not less than 80 per cent of the company, many people do not eat vomit website bones, in your vain for it with their lives after Kacha swap, which is very sad thing.    1, all by any website, the media out in the &...