Kent Sibilev wrote:
> $ irb
> irb(main):001:0> str="[1,2][2,1][3,1][4,1],"
> => "[1,2][2,1][3,1][4,1],"
> irb(main):002:0> str.gsub(/\]\[/, '],[').sub(/,$/, '')
> => "[1,2],[2,1],[3,1],[4,1]"
> 
> --
> Kent
Kent
ignore my first message please, yeah I have tried that but program still 
prints out as:
[12][21][31][41]

no commas :(

-- 
Posted via http://www.ruby-forum.com/.