I have the following C# string
var myString= "Unfortunately there has been an error processing {0}'s order"
I want to pass that string into my React app and interpolate it in js but there does not seem to be a clean way of doing it
In my React app I want to do something like this
myString.format("John Doe")
So that I can get this output: "Unfortunately there has been an error processing John Does's order"
Some posts I've seen here suggested to create your own .format()
method in js but I don't want to be reinventing the wheel if there are other solutions out there.