From: Tarael200@... Date: 2001-04-23T05:49:10+09:00 Subject: [ruby-talk:14032] Re: Question about strings, and arrays In a message dated 4/22/2001 4:08:23 PM Eastern Daylight Time, ms@iastate.edu writes: << Tarael200@aol.com wrote: > > Hello again all, > Okay, I know you can refer to strings in the following sense: > string[3] and such... Now, if you have an array of strings - array[3] refers > to the third string - how can I access the 5th character in the third string, > using that syntax? > > example code that doesn't meet my requirements: > array = %w(test bah hehehe hohoho) > print array[1][1] > > I thought that would print the 2nd character in the 2nd string - it doesn't. > I understand this is also the traditional multidimensional array syntax :) > > What's the deal here? What am I missing? > -malander Actually, it does, just not in the form you're expecting. There's no character type in ruby. If you want to see it as a string of length one, say print array[1][1].chr -- Mark >> Thank you for your speedy reply :-) -malander