From: Phrogz Date: 2009-11-10T14:10:07+09:00 Subject: Re: camelize On Nov 9, 1:43 am, Sijo k g wrote: > Hi >     I would like to get output as  "Re-Open"  for the input "re-open" > And I tried > "re-open".camelize         =>  "Re-open" > >      Could you please tell how can I do this? irb(main):001:0> s = "re-open" => "re-open" irb(main):002:0> class String; def simple_titleize irb(main):003:2> gsub(/\b[a-z]/i){ |x| x.upcase } irb(main):004:2> end; end => nil irb(main):005:0> s.simple_titleize => "Re-Open"