From: "Marcin Mielżyński" Date: 2006-08-20T01:35:12+09:00 Subject: Re: Convert "ThisIsSomeString" to "this_is_some_string"? Joshua Muheim wrote: > Marcin Mielżyński wrote: >> Joshua Muheim wrote: >>> Hi all >>> >>> What's the fastest way to convert "ThisIsSomeString" to >>> "this_is_some_string"? >>> >>> Thanks for help, >>> Joshua >>> >> p "ThisIsSomeString".scan(/[A-Z][a-z]+/).map{|w|w.downcase}.join('_') >> p "this_is_some_string".split('_').map{|w|w.capitalize}.join >> >> lopex > > syntax error near unexpected token `(' > > :-( > works for me, maybe some typo ? lopex