encoder class : HtmlEncode(string) method
Description
Encodes a string using HTML encoding.
Syntax
encoderInstance.HtmlEncode(string anyString)
Arguments
Class | Name | Description |
string | anyString | A string. |
Return value
Class | Description |
string | A string encoded by HTML encoding. |
Sample code
1: | encoder e = new encoder(); |
2: | string any = "<>"; |
3: | string encoded = e.HtmlEncode(any); // The result is "<>". |
Notes
It's a wrapper of the System.Web.HttpUtility.HtmlEncode(String) method.