On Mar 1, 9:42 am, "Rick DeNatale" <rick.denat... / gmail.com> wrote:
> On 3/1/08, Trans <transf... / gmail.com> wrote:
>
> > I've always wondered why String#capitalize downcases the whole string
> >  before it upcases the first letter. It's easy to subsequently downcase
> >  the string if that's what is wanted, but it's more cumbersome to
> >  capitalize the first letter on it's own. Ie.
>
> >  Currently,
>
> >   "the ATeam".capitalize  #=> "The ateam"
> >   "the ATeam".sub(/\A(.)/){ $1.upcase }  #=> "The ATeam"
>
> >  if otherwise,
>
> >   "the ATeam".capitalize.downcase  #=> "The ateam"
>
> Didn't you mean:
>
>      "the ATeam".downcase.capitalize #=> "The ateam"

Yes, thanks.

T.