Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shorter! #6

Open
p886 opened this issue Dec 12, 2013 · 1 comment
Open

shorter! #6

p886 opened this issue Dec 12, 2013 · 1 comment

Comments

@p886
Copy link

p886 commented Dec 12, 2013

Sorry for no pull request, but here's my solution using IRB-driven-development:

2.0.0p353 :034 > str
 => "_snake_case_string" 
2.0.0p353 :035 > str.gsub(/(^|_)[a-z]/) {|m| m.upcase.gsub("_","") }
 => "SnakeCaseString" 
@nellshamrell
Copy link
Owner

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants