5 kyu

Convert PascalCase string into snake_case

1,430 of 15,882OlgaGr

Description:

Complete the function/method so that it takes a PascalCase string and returns the string in snake_case notation. Lowercase characters can be numbers. If the method gets a number as input, it should return a string.

Examples

"TestController"  -->  "test_controller"
"MoviesAndBooks"  -->  "movies_and_books"
"App7Test"        -->  "app7_test"
1                 -->  "1"
Strings
Algorithms
Regular Expressions

More By Author:

Check out these other kata created by OlgaGr

Stats:

CreatedDec 1, 2013
PublishedDec 1, 2013
Warriors Trained25879
Total Skips3692
Total Code Submissions92479
Total Times Completed15882
Ruby Completions1430
JavaScript Completions5236
CoffeeScript Completions118
Python Completions7629
C# Completions1706
COBOL Completions6
Total Stars308
% of votes with a positive feedback rating87% of 1374
Total "Very Satisfied" Votes1072
Total "Somewhat Satisfied" Votes247
Total "Not Satisfied" Votes55
Ad
Contributors
  • OlgaGr Avatar
  • jhoffner Avatar
  • Bitman Avatar
  • NiklasE Avatar
  • anter69 Avatar
  • Souzooka Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • akar-0 Avatar
Ad