Why does the titlecase mess up the name? I have:
titlecase
John Mark McMillan
and it turns it into:
>> \"john mark McM
If all you want is to ensure that each word starts with a capital:
class String def titlecase2 self.split(' ').map { |w| w[0] = w[0].upcase; w }.join(' ') end end irb(main):016:0> "john mark McMillan".titlecase2 => "John Mark McMillan"