Assume the string is of the form
key1=value1;key2=value2;key3=value3
Yes, it is possible. Use string.split(";")
to separate the map entries into an array.
Then loop through the array, and for each entry, use string.split("=")
to separate the key from the value.
Then add the key and value to the new LinkedHashMap
:
String[] parts = entry.split("=");
map.put(parts[0], parts[1]); //parts[0] is the key, parts[1] is the value