Joshua Muheim wrote:
> Hi all
>
> What's the fastest way to convert "ThisIsSomeString" to
> "this_is_some_string"?
>
> Thanks for help,
> Joshua
>
> --
> Posted via http://www.ruby-forum.com/.

p ["FooBar","fooBar","FOOBar","FooBAR"].map{|s|
  s.gsub(/.(?=[A-Z])/,'\&_').downcase }

["foo_bar", "foo_bar", "f_o_o_bar", "foo_b_a_r"]