js如何在字符串前面添加空格

js如何在字符串前面添加空格,第1张

<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>

<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>


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11820966.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-18
下一篇2023-05-18

发表评论

登录后才能评论

评论列表(0条)

    保存