js 去除空格 摘抄

Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><SCRIPT LANGUAGE="JavaScript">
<!--
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>

posted on 2013-01-30 16:41  小小文豪  阅读(140)  评论(0编辑  收藏  举报

导航