Capitalize only first character of string and leave others alone? (Rails)

Posted by Daniel O'Connor on Stack Overflow See other posts from Stack Overflow or by Daniel O'Connor
Published on 2010-04-15T15:34:44Z Indexed on 2010/04/15 15:43 UTC
Read the original article Hit count: 192

Hi,

I'm trying to get Rails to capitalize the first character of a string, and leave all the others the way they are. I'm running into a problem where "i'm from New York" gets turned into "I'm from new york."

What method would I use to select the first character?

Thanks

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about beginner