Srinivas Jonnalagadda wrote:
> Please try these.
> 
> 1. str.gsub(/\]\[/, '],[')
> 
> 2. str.sub(/,$/, '')
> 
> Best regards,
> 
> JS

thank you JS, however it didn'r change anything.
I am still getting output as
[1,2][2,1][3,1][4,1]

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