I have one requirement where text field have information like below format:
String name = 'email,phone(Jason),mobile,address(Mason)';
Now what I want to do is create a Map<Key, List<String>>
where key will be name in brackets ex: Jason/Mason and values will be whatever is before that name in parentheses. So output should be like:
OUTPUT: {Jason=(email,Phone), Mason=(mobile,address)}
I had tried different ways but unable to format string 'email,phone(Jason), mobile,address(Mason)'. As there are parentheses Is it even possible to achieve this?
String
class. You should also edit your question to show us the attempt(s) you've made so far and include sample output from them (and/or the full, unmodified text and stack trace of any error(s) you're getting).