From: Michael Edgar Date: 2011-03-03T14:54:12+09:00 Subject: Re: How can i get the first letter of this string That won't work on Ruby 1.9, as bacon[0] will return the first actual character. This technique works on both: >> bacon = "chunky" => "chunky" >> bacon[0,1] => "c" Michael Edgar adgar@carboni.ca http://carboni.ca/ On Mar 3, 2011, at 12:32 AM, Thiago Massa wrote: > irb(main):023:0> bacon="chunky" > => "chunky" > irb(main):024:0> bacon[0] > => 99 > irb(main):025:0> bacon[0].chr > => "c" > > 99 is the ascii number that represents the letter 'c'. > > I think that explains what you want. > > -- > Thiago Fernandes Massa > 11 83979414