From: "Peter v. N." Date: 2005-10-13T21:36:57+09:00 Subject: Iterate over md Array (the Ruby way) Hi all, Once again I disturb you for a, maybe, obvious thing I can't figure out. I have successfully created an md array (see older posts from me) thanks to the support found here. Now I would like to list all String items in the source array (a Text file containing numbers) and convert and place them into the destination array as int objs. I know about the String#split method but this recreates an array that does not match the dimensions I want (e.g. lines with different length). My approach is very c-ish: # @source is a String array. If the string contains a non-convertible # substring, 0 is placed in destination array. @array is the destination # md array created with the appropriate dimensions according to @source # (longest line as vindex (-) and index as hindex (|) ) for i in 0...@hindex.length for j in 0...@vindex[i].length @array[i][j] = @source[i][j].to_i.char.to_i end end Is there a Ruby way to replace with blocks? Thank you very much for a hint. Brgds, Peter