SoFunction
Updated on 2025-03-02

js method to convert key-value pair strings into json strings

Key-value pair characters to be converted

 var respDesc=“cardid=64157001&cardnum=1&sporder_id=PD12160428120635001&sporder_time=20160526101552”;
 var newstr = ("=",":\""); 
 var stringObj= "{" +("&","\",") + "\"}";

The above method of converting key-value pair strings into json strings is all the content I share with you. I hope you can give you a reference and I hope you support me more.