How to convert a vector of strings to Title Case

前端 未结 5 1225
长情又很酷
长情又很酷 2021-01-11 19:00

I have a vector of strings in lower case. I\'d like to change them to title case, meaning the first letter of every word would be capitalized. I\'ve managed to do it with a

5条回答
  •  离开以前
    2021-01-11 19:16

    Here is another one-liner, based on stringr package:

    str_to_title(strings, locale = "en")
    

    where strings is your vector of strings.

    Source

提交回复
热议问题