js 去除空格
- SCRIPT LANGUAGE="JavaScript">
- <!--
- //出处:网上搜集
- // Trim() , Ltrim() , RTrim()
- 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>