From: Phrogz Date: 2007-06-15T04:55:04+09:00 Subject: Re: Characters and strings oddness On Jun 14, 12:27 pm, Zachary Holt wrote: > On Jun 14, 2007, at 11:01 AM, Stefan Kruger wrote: > > irb(main):002:0> string[0] == 't' > > string[0].chr == 't' > or > string[0] == ?t or string[0..0] == 't' It's a common gotcha that indexing a string by a single integer returns the (integer) CODE of the character/byte at that location, not the one-character string containing that byte.