ruby string capitalize? code example
Example 1: capitalize composed name ruby
require 'active_support/core_ext'
"kirk douglas".titleize #=> "Kirk Douglas"
Example 2: capitalize composed name ruby
'one TWO three foUR'.gsub(/\w+/, &:capitalize)
require 'active_support/core_ext'
"kirk douglas".titleize #=> "Kirk Douglas"
'one TWO three foUR'.gsub(/\w+/, &:capitalize)