I have string which will be in the format of
<!-- accountId="123" activity="add" request="add user" -->
Number of parameters and the order is random.
I need to get the value of request, I need to parse the add user text from the string. What is the best way to do this in Java?
You could parse it using regular expressions, something like this:
With example usage:
If you need to retain the ordering of the attributes you could use a LinkedHashMap or TreeMap, for example.