Tazinho / snakecase

🐍🐍🐍 A systematic approach to parse strings and automate the conversion to snake_case, UpperCamelCase or any other case.
https://tazinho.github.io/snakecase/
GNU General Public License v3.0
146 stars 9 forks source link

snake case with first letter uppercase #194

Closed AntoineSoetewey closed 2 years ago

AntoineSoetewey commented 2 years ago

Hello,

Thanks for creating this package.

I like snake case, but clients also like to see an uppercase in the first word, so something which would give "My variable name" --> "My_variable_name". At the moment, to_any_case("My variable name", case = "snake") will give me "my_variable_name" (without first letter uppercase).

Some workarounds (using other packages) will surely do it, but by any chance, do you expect to include this option too in the near future?

Regards, Antoine

Tazinho commented 2 years ago

Hi, sure. You can use

library(snakecase)
to_sentence_case("My variable name", sep_out = "_")
#> [1] "My_variable_name"
AntoineSoetewey commented 2 years ago

Perfect, thanks a lot!