From: "Jan E." Date: 2012-10-03T06:37:42+09:00 Subject: Re: Void value expression error? Ruby is actually very different from Java, regarding both the syntax and the general approach. Java has a C-like syntax and is pretty low level with a lot of classical procedural programming (increment this counter, decrement that one etc.). Ruby, on the other hand, has a syntax roughly similar to Pascal and is very high level. Instead of juggling with flags and counters, you can use methods known from functional programming like "select", "reject", "map", "zip" etc., which will make your code much more readable and compact. So when you program with Ruby, it might be a good idea to forget everything you know from Java and actually use the features Ruby is offering. If I understand you correctly, you have a kind of CSV with rows ending with "$" and columns ending with "|" and want to make a 2 dimensional array out of it. In Ruby, this is as simple as test_csv = 'a|b|c|$d|e|f|$' table = test_csv.split('$').map {|row| row.split('|')} p table (To be fair, this will get a bit longer if you also want to take empty fields into account) There are also specialized CSV libraries that might be more appropriate than reading everything into an array. But even if you want to stick to your approach, you could still make it much shorter just by omitting the Java-like boilerplate code and using built-in methods. You don't need to initialize arrays with a certain length, and you don't need to define your own methods for splitting strings or counting substrings. -- Posted via http://www.ruby-forum.com/.