Is there an easy (maybe even single and simple command) way to build a hashtable (associative array, JSON - whatever) from a string that includes key-value pairs, separated by a given delimiter.
Example:
n1=v1&n2=v2&n3=v3
(where &
is a delimiter)
should return: [{n1:v1}, {n2:v2}, {n3:v3}]
Example 2:
n1=v1;n2=v2;n3=v3
(where ;
is a delimiter)
Thanks!