I have a hash
something like :
abc=>1
hello=>32
abc=>4
hello=>23
hello=>12
xyz=>18
how can we concatenate the values, whose keys are same.
So the output will be:
abc=>"1,4"
hello=>"23,12,32"
xyz=>"18".
I tried by sorting the hash by keys then checking for each key, if they are same then concatenate the value, but i am not getting that how to compare two keys in same loop.
Thanks in advance.