How can I split string like key and value using scala in efficient way:
I would like to split below emp string into key value pair.
var emp = "Map(employees -> [{"id":"100","name":"Alex","state":"MA"},{"id":"101","name":"Agni","state":"CA"},{"id":"102","name":"Sharo","state":"TX"}])"
Need to parse like below :
key: employees
value : [{"id":"100","name":"Alex","state":"MA"},{"id":"101","name":"Agni","state":"CA"},{"id":"102","name":"Sharo","state":"TX"}]
emplooks like it's already in the format you're asking for.