i have a string which contains multiple key and value inside it.
bodyString = "Product ID:\nPDAZ03015022\n\nAddress:\nUnit 3A, Block A, Palm Spring Condominium\n\nProduct Price (in CP): 5000\n\nProcessing Fee (in CP): 22000\n\nTax Fee (if any): 5CP",
now i want to extract the key-value pair as below.
bodyObject =
{
"Product ID": "PDAZ03015022",
"Address": "Unit 3A, Block A, Palm Spring Condominium",
"Product Price (in CP)": "5000",
"Processing Fee (in CP)": "22000",
"Tax Fee (if any)": "5CP"
}
how can i achieve this in javascript?