Thursday, 3 October 2013

How to capitalize first letter of each world in the string

How to capitalize first letter of each world in the string

How to capitalize first letter of each world in the string in Ruby on Rails:
"goyette-xyz-is wide road".titleize returns "Goyette Xyz Is Wide Road".
I want the output like:
"goyette-xyz is wide road".SOME-FUNCTION should return "Goyette-xyz-is
Wide Road".
titleize removes the underscore and hyphens but i want to keep it in the
string.