Concatinating values of a matching string in an arrray
I have a string array[2] as follows:
1st Array 2nd Aray
"100101" "Testing123"
"100102" "Apple123"
"100101" "Dog123"
"100104" "Cat123"
"100101" "Animal123"
I would like to concatenate all elements of the 2nd array if the elements
in the first array match.
For example elements of the first array that match are "100101", "100101"
and "100101". So a string with the concatenated values of the respective
2nd array would be as follows:
"Testing123 Dog123 Animal123"
How could this be achieved elegantly?
No comments:
Post a Comment