Uri.HexUnescape(String, Int32) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Converts a specified hexadecimal representation of a character to the character.
public:
static char HexUnescape(System::String ^ pattern, int % index);
public static char HexUnescape(string pattern, ref int index);
static member HexUnescape : string * int -> char
Public Shared Function HexUnescape (pattern As String, ByRef index As Integer) As Char
- pattern
- String
The hexadecimal representation of a character.
- index
- Int32
The location in pattern
where the hexadecimal representation of a character begins.
The character represented by the hexadecimal encoding at position index
. If the character at index
is not hexadecimal encoded, the character at index
is returned. The value of index
is incremented to point to the character following the one returned.
index
is less than 0 or greater than or equal to the number of characters in pattern
.
The following code example determines whether a character is hexadecimal encoded and, if so, writes the equivalent character to the console.
String^ testString = "%75";
int index = 0;
if ( Uri::IsHexEncoding( testString, index ) )
{
Console::WriteLine( "The character is {0}",
Uri::HexUnescape( testString, index ) );
}
else
{
Console::WriteLine( "The character is not hex encoded" );
}
string testString = "%75";
int index = 0;
if (Uri.IsHexEncoding(testString, index))
Console.WriteLine("The character is {0}", Uri.HexUnescape(testString, ref index));
else
Console.WriteLine("The character is not hexadecimal encoded");
let testString = "%75"
let mutable index = 0
if Uri.IsHexEncoding(testString, index) then
printfn $"The character is {Uri.HexUnescape(testString, &index)}"
else
printfn "The character is not hexadecimal encoded"
Dim testString As String = "%75"
Dim index As Integer = 0
If Uri.IsHexEncoding(testString, index) Then
Console.WriteLine("The character is {0}", Uri.HexUnescape(testString, index))
Else
Console.WriteLine("The character is not hexadecimal encoded")
End If
Продукт | Версии |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: