From: "Brian Schröder" Date: 2005-10-17T04:56:32+09:00 Subject: Re: Iterate over md Array (the Ruby way) > > See if this helps: > > array = < 0000022340 > 0023457000 > 0000000110 > AGCTAGCT12345 > AAA3BBBCC > AAACC > EOM > > max = array.map {|st| st.chomp.size }.max > array.each {|s| s.replace(s.rjust(max,"0")).gsub!(/\D/,"0") } > puts array > > > David > Hello David, that is cool. I did not know that it was possible to chain methods to a herdoc like this. thanks for the enlightenment, best regards, Brian > > -- > David A. Black > dblack@wobblini.net > > -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/