Hi,
I notice that the String class doesn´t have some simple methods. So, I
added these:
ltrim: function() {
var re = /\s*((\S+\s*)*)/;
return this.replace(re, "$1");
},
rtrim: function() {
var re = /((\s*\S+)*)\s*/;
return this.replace(re, "$1");
},
trim: function() {
return this.rtrim().ltrim();
},
invert: function() {
var len = this.length;
var str = "";
for (var i = len - 1; i > -1 ;i--){
str += this.charAt(i);
}
return str;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---