encoder class : UrlEncode(string) method
Description
Encodes a string using URL encoding.
Syntax
encoderInstance.UrlEncode(string anyString)
Arguments
Class | Name | Description |
string | anyString | A string. |
Return value
Class | Description |
string | A string encoded by URL encoding. |
Sample code
1: | encoder e = new encoder(); |
2: | string any = "日本語"; |
3: | string encoded = e.UrlEncode(any); // The result is "%E6%97%A5%E6%9C%AC%E8%AA%9E". |
Notes
It's a wrapper of the System.Web.HttpUtility.UrlEncode(String) method.
This method will encode using UTF-8.