SyntaxFix
Write A Post
Hire A Developer
Questions
An object oriented solution:
class String def capitalize_first_char self.sub(/^(.)/) { $1.capitalize } end end
Then you can just do this:
"i'm from New York".capitalize_first_char