5 kyu

Convert PascalCase string into snake_case

1,434 of 16,100OlgaGr

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 Trained26201
Total Skips3710
Total Code Submissions93110
Total Times Completed16100
Ruby Completions1434
JavaScript Completions5322
CoffeeScript Completions118
Python Completions7741
C# Completions1727
COBOL Completions7
Total Stars309
% of votes with a positive feedback rating87% of 1392
Total "Very Satisfied" Votes1087
Total "Somewhat Satisfied" Votes250
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