You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you use hello world as the input to ToCamelCase you get Hello world. I was expecting to see HelloWorld instead. Looking at ToKebab and ToSnakeCase I did get the expected results: hello-world and hello_world .
One way I can get the behaviour I want is to do ToCamelCase(toSnakeCase("hello world")).
The text was updated successfully, but these errors were encountered:
It's an undefined behavior in ToCamelCase. As this function was designed for variable name conversion, e.g. get_key to GetKey, space is not expected in the source string.
We can define this behavior just like what you suggested. See #1 for new rules.
huandu
changed the title
ToCamelCase spaces
ToCamelCase handles spaces as word connector
Jan 12, 2020
Shouldn't the
ToCamelCase
handle spaces?When you use
hello world
as the input toToCamelCase
you getHello world
. I was expecting to seeHelloWorld
instead. Looking atToKebab
andToSnakeCase
I did get the expected results:hello-world
andhello_world
.One way I can get the behaviour I want is to do
ToCamelCase(toSnakeCase("hello world"))
.The text was updated successfully, but these errors were encountered: