js es6 最短语句实现语句首字母大写

2018-10-29  本文已影响0人  此昵称已被狗抢占
'hello world'.replace(/^\S/, s => s.toUpperCase())
//> 'Hello world'
上一篇 下一篇

猜你喜欢

热点阅读