/ Published in: Ruby
Expand |
Embed | Plain Text
class String def camelize self.split(/[^a-z0-9]/i).map{|w| w.capitalize}.join end end
Comments
Subscribe to comments
You need to login to post a comment.
naehrstoff on 12/29/08
4 people have marked this snippet as a favorite
class String def camelize self.split(/[^a-z0-9]/i).map{|w| w.capitalize}.join end end
Subscribe to comments
You need to login to post a comment.
"bla_bla".camelize