I have a string in the following format :
"(1,X) (3,2) (5,2) (7,2)"
Basically the first element can be any positive integer, the second element is either '1' 'X' or '2'. The string can be of varying length with the minimum being one element. I want to split this string and store each of the
(int, String)
pairs in a HashMap with the int acting as the key and the String being the object. I'm not too sure how to use the split method here and would be grateful for a short guidance.