In .NET 4, The HttpUtility class has a variety of static encoding methods for various contexts, including a JavaScriptStringEncode
method for this particular purpose.
It’s often simpler to just use JSON deserialization, though.
In .NET 4, The HttpUtility class has a variety of static encoding methods for various contexts, including a JavaScriptStringEncode
method for this particular purpose.
It’s often simpler to just use JSON deserialization, though.