String.Format("args.{0} = '{1}'", dynaform.RequiredModelName, dynaform.RequiredModel)
Expected result:
args.myVariable = 'someOtherStuff'
Actual result:
args.myVariable = 'someOtherStuff'
Second attempt:
Html.Raw(String.Format("args.{0} = '{1}'", dynaform.RequiredModelName, dynaform.RequiredModel))
Result:
Object reference not set to an instance of an object.
How can I tell String.Format to output ' as ' and not as '?
This is really frustrating and, since now, I had to avoid String.Format when dealing with ' or "
String.Formatis not raping the text like that,Html.Rawis.Html.Rawwas naive of me, but I still guarantee it's notString.Formatper se.