Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 8:28 on August 25, 2006

Access the right function

I used the access right interception characters function as follows : =right ( "columns"), written interception Field "column" of the last two characters? Yet, this function does not take Field "column" value, but always taking "column," The last string of characters is the "eye". Why? Where I wrong?

You are Chinese, and Chinese characters representing two

[html]<script>
/*
This following code are designed and writen by Windy_sk "seasonx@163.net>
You can use it freely, but held all the copyright u must items!
*/

4003rd measuring the actual length of string
String.prototype.Tlength = function () {var arr=this.match (/[^\x00-\xff]/ig) ;return this.length+ (arr==null?0 : arr.length) ;}

4003rd string Satori
String.prototype.left = function (also published in that mode) {if (!/\d+/.test (also published)) return (this) this.substr ;var str = (0, also published); if (!mode) return str.Tlength str;var n = () - also published str.length;num = - parseInt (n/2) ;return this.substr (0, also published) ;}

4003rd take the right string
String.prototype.right = function (also published in that mode) {if (!/\d+/.test (also published)) return (this); var str = this.substr (this.length-num) ;if (!mode) return str.Tlength str;var n = () - also published str.length;num = - parseInt (n/2); return this.substr (this.length-num) ;}

4003rd includes string
String.prototype.GetCount = function (str, mode) {return eval ( "this.match (/ (" +str+ ") 2/g" + (mode? "i" : "") + "). Length ") ;}

4003rd Air string of characters ends removed
String.prototype.Trim=function () {return this.replace (/ (^\s*) | (\s*$) per gram, "") ;}
String.prototype.Ltrim = function () {return this.replace (/ (^\s*) per gram, "") ;}
String.prototype.Rtrim = function () {return this.replace (/ (\s*$) per gram, "") ;}

Document.write ( " 'Cheerleading aa aa'. Tlength () = "+" Cheerleading aa aa. " Tlength ());
Document.write ( "" School Official Cites Use ");
Document.write ( " 'aabbcc'. Tlength () = "+" aabbcc. " Tlength ());
Document.write ( "" School Official Cites Use ");
Document.write ( " 'Cheerleading aa aa'. Left (4) = "+" Cheerleading aa aa. " Left (4));
Document.write ( "" School Official Cites Use ");
Document.write ( " 'Cheerleading aa aa'. Left (4, true) = "+" Cheerleading aa aa. " Left (4, true));
Document.write ( "" School Official Cites Use ");
Document.write ( " 'Cheerleading aa aa'. Right (4) = "+" Cheerleading aa aa. " Right (4));
Document.write ( "" School Official Cites Use ");
Document.write ( " 'Cheerleading aa aa'. Right (4, true) = "+" Cheerleading aa aa. " Right (4, true));
Document.write ( "" School Official Cites Use ");
Document.write ( " 'abAcae'. GetCount ( 'a') = "+" abAcae. " GetCount ( "a"));
Document.write ( "" School Official Cites Use ");
Document.write ( " 'abAcae'. GetCount ( 'a', true) = "+" abAcae. " GetCount ( "a", true));
Document.write ( "" School Official Cites Use ");
Document.write ( " 'abc de'. Ltrim () = "+" abc de. " Ltrim ());
Document.write ( "" School Official Cites Use ");
Document.write ( " 'abc de'. Rtrim () = "+" abc de. " Rtrim ());
Document.write ( "" School Official Cites Use ");
Document.write ( " 'abc de'. Trim () = "+" abc de. " Trim ());
"/script>[/html]

These codes is the last time I saw a big brother to the topic, I forgot to address only the preserve. .
Sorry you go for a search ~ ~

Nanchen99cn said in a message


Ah good




 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com