Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: string JsEscape(this string, JsQuotes)

Declaration

public static string JsEscape(
    this string input,
    JsQuotes quotes = JsQuotes.Double
)

Summary

Returns a JavaScript- or JSON-compatible representation of the string with the appropriate characters escaped.

Parameters

this stringinput String to escape.
JsQuotesquotes Specifies what type of quotes to put around the result, if any.

Returns

JavaScript- or JSON-compatible representation of the input string.