From: Trans Date: 2008-03-02T00:16:14+09:00 Subject: Re: capitalize and downcase On Mar 1, 9:42 am, "Rick DeNatale" wrote: > On 3/1/08, Trans 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.