会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Loading
hello word
首页
管理
2020年4月3日
「思考题」模拟实现字符串的trim()函数
摘要: String.prototype.trim = function () { let reg = /(^\s*)|(\s*$)/g return this.replace(reg, '') } // 测试 let str = ' hello word ' console.log(str.trim())
阅读全文
posted @ 2020-04-03 17:33 fsdffsdf
阅读(192)
评论(0)
推荐(0)