Lodash title case (uppercase first letter of every word)

前端 未结 13 1660
萌比男神i
萌比男神i 2021-01-30 19:25

I\'m looking through the lodash docs and other Stack Overflow questions - while there are several native JavaScript ways of accomplishing this task, is there a way I can convert

相关标签:
13条回答
  • 2021-01-30 19:59

    with lodash 4, you can use _.capitalize()

    _.capitalize('JOHN') It returns 'John'

    See https://lodash.com/docs/4.17.5#capitalize for details

    0 讨论(0)
提交回复
热议问题