2
4

1 回答 1

0

In C# you have the System.Web.HttpUtility.JavaScriptStringEncode() call available that will prepend single quotes with a backslash.

http://msdn.microsoft.com/en-us/library/system.web.httputility.javascriptstringencode.aspx

From the URL above:

This method encodes strings. For instance, single quotation marks and double quotation marks are included as \' and \" in the encoded string.

于 2012-10-12T15:02:24.643 回答