From: Sean O'Dell Date: 2002-04-10T10:36:52+09:00 Subject: Easy character comparisons Today I spent a little time debugging something I "didn't expect." I evaluated (using if) string[index] against a single character in a string and for awhile, I couldn't figure out why it wasn't working. Then I realized that string[index] returns a number, not a string containing a single character. Example: "string"[0] == "s" => false I ended up having to change the expression to something like this: "string"[0..0] == "s" => true Is there a more elegant way of doing this sort of comparison? My fudged way seems awkward. Sean