Uri.IsHexEncoding Method (String, Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Determines whether a character in a string is hexadecimal encoded.

Namespace:   System
Assembly:  System (in System.dll)

static member IsHexEncoding : 
        pattern:string *
        index:int -> bool


Type: System.String

The string to check.

Type: System.Int32

The location in pattern to check for hexadecimal encoding.

Return Value

Type: System.Boolean

A Boolean value that is true if pattern is hexadecimal encoded at the specified location; otherwise, false.

The IsHexEncoding method checks for hexadecimal encoding that follows the pattern "%hexhex" in a string, where "hex" is a digit from 0 to 9 or a letter from A-F (case-insensitive).

The following code example determines whether a character is hexadecimal encoded and, if so, writes the equivalent character to the console.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top