String.IConvertible.GetTypeCode メソッド

定義

String クラスには TypeCode を返します。

C#
TypeCode IConvertible.GetTypeCode ();

戻り値

TypeCode

列挙型定数 String

実装

次の例では、型の列挙定数を表示し TypeCode String ます。

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.
*/

適用対象

製品 バージョン
.NET Core 1.0, Core 1.1
.NET Standard 1.3, 1.4, 1.5, 1.6
UWP 10.0