<SCRIPT LANGUAGE= "JavaScript ">
<!--
// Trim() , Ltrim() , RTrim() 函数
function String.prototype.Trim(){return this.replace(/(^\s*)|(\s*$)/g, " ");}
function String.prototype.LTrim(){return this.replace(/(^\s*)/g, " ");}
function String.prototype.RTrim(){return this.replace(/(\s*$)/g, " ");}
//用法:
//Trim()函数(去除前后空格)
alert( " abc ".Trim().length);
//LTrim()函数(去除前面的空格)
alert( " abc ".LTrim().length);
//Trim()函数(去除后面的空格)
alert( " abc ".RTrim().length);
//-->
</SCRIPT>
<!--
// Trim() , Ltrim() , RTrim() 函数
function String.prototype.Trim(){return this.replace(/(^\s*)|(\s*$)/g, " ");}
function String.prototype.LTrim(){return this.replace(/(^\s*)/g, " ");}
function String.prototype.RTrim(){return this.replace(/(\s*$)/g, " ");}
//用法:
//Trim()函数(去除前后空格)
alert( " abc ".Trim().length);
//LTrim()函数(去除前面的空格)
alert( " abc ".LTrim().length);
//Trim()函数(去除后面的空格)
alert( " abc ".RTrim().length);
//-->
</SCRIPT>