String.GetTypeCode メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
public:
virtual TypeCode GetTypeCode();
public TypeCode GetTypeCode ();
abstract member GetTypeCode : unit -> TypeCode
override this.GetTypeCode : unit -> TypeCode
Public Function GetTypeCode () As TypeCode
戻り値
列挙型定数 String。
実装
例
次の例では、 TypeCode 型の列挙定数を表示 String します。
// Sample for String.GetTypeCode()
using namespace System;
int 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.
*/
// 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.
*/
' Sample for String.GetTypeCode()
Class Sample
Public Shared Sub Main()
Dim str As [String] = "abc"
Dim tc As TypeCode = str.GetTypeCode()
Console.WriteLine("The type code for '{0}' is {1}, which represents {2}.", _
str, tc.ToString("D"), tc.ToString("F"))
End Sub
End Class
'
'This example produces the following results:
'The type code for 'abc' is 18, which represents String.
'