HttpUtility.JavaScriptStringEncode 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
对字符串进行编码。
重载
| 名称 | 说明 |
|---|---|
| JavaScriptStringEncode(String) |
对字符串进行编码。 |
| JavaScriptStringEncode(String, Boolean) |
对字符串进行编码。 |
注解
此方法对字符串进行编码。 例如,单引号和双引号包含在\u0027\"编码字符串中。
JavaScriptStringEncode(String)
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
对字符串进行编码。
public:
static System::String ^ JavaScriptStringEncode(System::String ^ value);
public static string JavaScriptStringEncode(string? value);
public static string JavaScriptStringEncode(string value);
static member JavaScriptStringEncode : string -> string
Public Shared Function JavaScriptStringEncode (value As String) As String
参数
- value
- String
要编码的字符串。
返回
编码的字符串。
适用于
JavaScriptStringEncode(String, Boolean)
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
对字符串进行编码。
public:
static System::String ^ JavaScriptStringEncode(System::String ^ value, bool addDoubleQuotes);
public static string JavaScriptStringEncode(string? value, bool addDoubleQuotes);
public static string JavaScriptStringEncode(string value, bool addDoubleQuotes);
static member JavaScriptStringEncode : string * bool -> string
Public Shared Function JavaScriptStringEncode (value As String, addDoubleQuotes As Boolean) As String
参数
- value
- String
要编码的字符串。
- addDoubleQuotes
- Boolean
一个值,该值指示是否在编码字符串周围包含双引号。
返回
编码的字符串。