Uri.HexUnescape(String, Int32) Método
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Convierte una representación hexadecimal especificada de un carácter en el carácter.
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
Representación hexadecimal de un carácter.
- index
- Int32
Ubicación en pattern
donde comienza la representación hexadecimal de un carácter.
Carácter representado por la codificación hexadecimal en la posición index
. Si el carácter de index
no tiene codificación hexadecimal, se devuelve el carácter de index
. El valor de index
se aumenta para que apunte al carácter siguiente al devuelto.
index
es menor que 0 ó mayor o igual que el número de caracteres de pattern
.
En el ejemplo de código siguiente se determina si un carácter está codificado hexadecimal y, si es así, escribe el carácter equivalente en la consola.
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
Producto | Versiones |
---|---|
.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 |
Comentarios de .NET
.NET es un proyecto de código abierto. Seleccione un vínculo para proporcionar comentarios: