String.GetTypeCode 메서드

정의

클래스에 TypeCode 대한 값을 반환합니다 String .

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 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.
*/
let str = "abc"
let tc = str.GetTypeCode()
printfn $"""The type code for '{str}' is {tc.ToString "D"}, which represents {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.
'

적용 대상