From: Ron Jeffries Date: 2002-02-12T10:51:23+09:00 Subject: Re: [newbie] make first letter lowercase On Mon, 11 Feb 2002 22:45:12 GMT, Joel VanderWerf wrote: >sebi wrote: >> >> hello, >> >> sorry for this very simple question, but how would i turn the first >> letter of a string into lowercase? > >x = "FOO" >x[0,1] = x[0,1].downcase >x > > ==> "fOO" What may not be obvious to a newbie is that 'abc'[0] is a number, while 'abc'[0,1] is a substring of the string 'abc', starting at zero and up to and not including 1, i.e. it is the string 'a'. Ruby, in its everlasting wisdom, doesn't really understand characters other than as numbers. If the above seems odd to you, you are not alone. Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.