Noob question string problem

Hu there guys,

I hava some problem with the strings, the double-quoted ones.

here is my code :

a = “parsley”

but a[0] returns 112 which is ASCII for ‘o’ not ‘p’
the same for a[1] a[2] they all return the incorrect ascii code for my
characters…

is somethig wrong with my ruby or my code??

Thx in advance for all your time and help,
radu

On Sat, Jun 12, 2010 at 9:49 AM, rpuspana [email protected] wrote:

a = “parsley”

but a[0] returns 112 which is ASCII for ‘o’ not ‘p’

is somethig wrong with my ruby or my code??

I think something’s wrong with the ASCII lookup table you’re using :slight_smile:


Hassan S. ------------------------ [email protected]
twitter: @hassan

I’d agree with Hassen here. p is 112 decimal.
http://en.wikipedia.org/wiki/Ascii#ASCII_printable_characters

http://en.wikipedia.org/wiki/Ascii#ASCII_printable_charactersRegards,
James

On Sun, Jun 13, 2010 at 5:08 AM, Hassan S. <