I have an object like this.
var obj = {Id:1,Rate:5,Price:200,Name:\"History\"}
And a template like this.
var templateString
Without using regex, this can be done by finding all the properties of the object using Object.keys and then replace each of them by it's value.
Object.keys
Try like this:
Object.keys(obj).forEach(key => { templateString = templateString.replace(`**${key}**`, `"${obj[key]}"`); });