String.IConvertible.GetTypeCode Método

Definición

Devuelve la instancia de TypeCode para la clase String.

C#
TypeCode IConvertible.GetTypeCode ();

Devoluciones

Constante enumerada, String.

Implementaciones

Ejemplos

En el ejemplo siguiente se muestra la TypeCode constante enumerada para el String tipo .

C#
// Sample for String.GetTypeCode()
using System;

class Sample
{
    public static void Main()
    {
    String str = "abc";
    TypeCode tc = str.GetTypeCode();
    Console.WriteLine("The type code for '{0}' is {1}, which represents {2}.",
                         str, tc.ToString("D"), tc.ToString("F"));
    }
}
/*
This example produces the following results:
The type code for 'abc' is 18, which represents String.
*/

Se aplica a

Produto Versións
.NET Core 1.0, Core 1.1
.NET Standard 1.3, 1.4, 1.5, 1.6
UWP 10.0