Like many others, I wrote a Ruby port of TitleCase.pl. I used it as excuse to make my first RubyGem.
gem install titleize
require 'titleize'
"an example of titling".titleize # => "An Example of Titling"
If you prefer, titlecase
is an alias to titleize
.
If Rails is running, titleize
will install itself on Inflector
and still convert underscores and CamelCase like the default Rails titleize
.
previously: Set an Icon With Rubycocoa