wes d2a2ba9e15 first commit | %!s(int64=4) %!d(string=hai) anos | |
---|---|---|
.. | ||
README.md | %!s(int64=4) %!d(string=hai) anos | |
code.cpp | %!s(int64=4) %!d(string=hai) anos | |
unitTest.cpp | %!s(int64=4) %!d(string=hai) anos |
by Matt tags: algorithms, regex, formatting, strings
Create two functions toCamelCase() and toSnakeCase() that each take a single string and convert it into either camelCase or snake_case. If you're not sure what these terms mean, check the Resources tab above. Examples toCamelCase("hello_edabit") ➞ "helloEdabit" toSnakeCase("helloEdabit") ➞ "hello_edabit" toCamelCase("ismodalopen") ➞ "isModalOpen" toSnakeCa
Create two functions toCamelCase()
and toSnakeCase()
that each take a single string and convert it into either camelCase or snake_case. If you're not sure what these terms mean, check the Resources tab above.
toCamelCase("hello_edabit") ➞ "helloEdabit"
toSnakeCase("helloEdabit") ➞ "hello_edabit"
toCamelCase("is_modal_open") ➞ "isModalOpen"
toSnakeCase("getColor") ➞ "get_color"
Test input will always be appropriately formatted as either camelCase or snake_case, depending on the function being called.