Why does the titlecase
mess up the name? I have:
John Mark McMillan
and it turns it into:
>> \"john mark McM
If you want to handle the case where someone has entered JOHN CAPSLOCK JOE
as well as the others, I combined this one:
class String
def proper_titlecase
if self.titleize.split.length == self.split.length
self.titleize
else
self.split(" ").collect{|word| word[0] = word[0].upcase; word}.join(" ")
end
end
end
Depends if you want that kinda logic on a String method ;)