다음을 통해 공유


String.GetTypeCode 메서드

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

네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Function GetTypeCode As TypeCode
‘사용 방법
Dim instance As String
Dim returnValue As TypeCode

returnValue = instance.GetTypeCode
public TypeCode GetTypeCode ()
public:
virtual TypeCode GetTypeCode () sealed
public final TypeCode GetTypeCode ()
public final function GetTypeCode () : TypeCode

반환 값

열거형 상수인 TypeCode.String입니다.

예제

다음 코드 예제에서는 String 형식의 TypeCode 열거형 상수를 표시합니다.

' Sample for String.GetTypeCode()
Imports System

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 'Main
End Class 'Sample
'
'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()
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()
import System.*;

class Sample
{
    public static void main(String[] args)
    {
        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"));
    } //main
} //Sample
/*
This example produces the following results:
The type code for 'abc' is 18, which represents String.
*/

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

String 클래스
String 멤버
System 네임스페이스