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 thank you very much,But I did that and I got
[12][2,1][3,1][4,1] it got rid of last comma but also got rid of the 
first comma between 1 and 2 and print them out like 12
any clue?
thank you

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