From: Tony Arcieri Date: 2010-12-09T09:04:54+09:00 Subject: Re: Splitting on capital letters --0016e6db680fa46c6a0496eefc6a Content-Type: text/plain; charset=ISO-8859-1 Here's an ActiveSupport-powered roflscale method: > "BenefitsAndFeatures".underscore.split('_').map(&:capitalize).join('-') => "Benefits-And-Features" On Wed, Dec 8, 2010 at 5:02 PM, Ralph Shnelvar wrote: > JB> Whether or not this is a good way may be up for debate, but it's *a* > way: > > irb(main):001:0>> > "BenefitsAndFeatures".split(/([[:upper:]][[:lower:]]*)/).delete_if(&:empty?).join("-") > =>> "Benefits-And-Features" > > This is sooo far beyond my skill level. > > I'm gonna have to study this one for a while. > > Thanks! > > Ralph -- Tony Arcieri Medioh! Kudelski --0016e6db680fa46c6a0496eefc6a--