Coder UrlEncode Method (String)C# API
Encodes a string using percent-encoding.

Namespace: Facilita.Web
Assembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.5.8.37 (1.0.0.0)
Syntax

public static string UrlEncode(
	string urlFragment
)

Parameters

urlFragment
Type: System String
The text to percent-encode.

Return Value

The encoded text.
Remarks

A character in the string will be percent-encoded if:
  • It is outside the printable ASCII range (i.e. is not in the ASCII range 32 to 127) OR
  • It is one of the DefaultUnsafeCharacters

For more information about percent-encoding, refer to OnlineRFC 3986.

Examples

The following example demonstrates encoding a string.
string encoded = Coder.UrlEncode("search?q=camera");
// encoded == search%3Fq%3Dcamera
See Also