encoder クラス : HtmlEncode(string) メソッド
説明
HTMLエンコーディングを使用して文字列をエンコードします。
構文
encoderInstance.HtmlEncode(string anyString)
引数
| クラス | 名前 | 説明 |
| string | anyString | エンコードする文字列。 |
返り値
| クラス | 説明 |
| string | HTMLエンコーディングでエンコードされた文字列。 |
サンプルコード
| 1: | encoder e = new encoder(); |
| 2: | string any = "<>"; |
| 3: | string encoded = e.HtmlEncode(any); // 結果は、"<>" です。 |
注意
これは、System.Web.HttpUtility.HtmlEncode(String) メソッドのラッパーです。


