// trim
String.prototype.trim=function(){
return this.replace(/(^\s*)|(\s*$)/g, "");
}
//reverse
String.prototype.reverse=function reverse() {
var str = "";
var end = this.length - 1;
for(;end >= 0; end --) {
str = str + this.charAt(end);
}
return str;
}
网友评论