매일매일개발/Codewars
codewars #78 Convert PascalCase string into snake_case (5kyu)
개하싶
2018. 7. 12. 21:52
#78 Convert PascalCase string into snake_case
Complete the function/method so that it takes CamelCase string and returns the string in snake_case notation. Lowercase characters can be numbers. If method gets number, it should return string.
Examples:
// returns test_controller
toUnderscore('TestController');
// returns movies_and_books
toUnderscore('MoviesAndBooks');
// returns app7_test
toUnderscore('App7Test');
// returns "1"
toUnderscore(1);