Strings.ChrW(Int32) 메서드
정의
지정한 문자 코드와 연관된 문자를 반환합니다.Returns the character associated with the specified character code.
public:
static char ChrW(int CharCode);
public static char ChrW (int CharCode);
static member ChrW : int -> char
Public Function ChrW (CharCode As Integer) As Char
매개 변수
- CharCode
- Int32
필수 요소.Required. 문자에 대한 코드 포인트
또는 문자 코드를 나타내는 Integer
식입니다.An Integer
expression representing the code point
, or character code, for the character.
반환
지정한 문자 코드와 연관된 문자입니다.The character associated with the specified character code.
예외
ChrW
에 대해 CharCode
< -32768 또는 > 65535입니다.CharCode
< -32768 or > 65535 for ChrW
.
예제
다음 예제에서는 함수를 사용 하 여 Chr
지정 된 문자 코드와 연결 된 문자를 반환 합니다.The following example uses the Chr
function to return the character associated with the specified character code.
Dim associatedChar As Char
' Returns "A".
associatedChar = Chr(65)
' Returns "a".
associatedChar = Chr(97)
' Returns ">".
associatedChar = Chr(62)
' Returns "%".
associatedChar = Chr(37)
설명
CharCode
에 대해 허용되는 비대칭 범위는 Short
및 Integer
사이의 스토리지 차이를 보완합니다.The asymmetric range accepted for CharCode
compensates for the storage differences between the Short
and the Integer
. 예를 들어-29183는 Short
이지만 + 36353는 Integer
입니다.For example, -29183 is a Short
but +36353 is an Integer
. 이는 Visual Basic 6.0과의 호환성을 용이 하 게 합니다.This also facilitates compatibility with Visual Basic 6.0.
Chr
Encoding네임 스페이스의 클래스를 사용 하 여 System.Text 현재 스레드에서 SBCS (싱글바이트 문자 집합)를 사용 하 고 있는지, 아니면 더블 바이트 문자 집합 (DBCS)을 사용 하는지 확인 합니다.Chr
uses the Encoding class in the System.Text namespace to determine if the current thread is using a single-byte character set (SBCS) or a double-byte character set (DBCS). 그런 다음 CharCode
적절 한 집합에서 코드 포인트를 사용 합니다.It then takes CharCode
as a code point in the appropriate set. SBCS의 범위는 0 ~ 255이 고,-32768은 DBCS 문자에 대해 65535 ~입니다.The range can be 0 through 255 for SBCS characters and -32768 through 65535 for DBCS characters.
반환 된 값은 ANSICodePage TextInfo 네임 스페이스에 있는 클래스의 속성에 포함 된 현재 스레드의 코드 페이지에 따라 달라 집니다 System.Globalization .The returned value depends on the code page for the current thread, which is contained in the ANSICodePage property of the TextInfo class in the System.Globalization namespace. 을 지정 하 여를 가져올 수 있습니다 ANSICodePage System.Globalization.CultureInfo.CurrentCulture.TextInfo.ANSICodePage
.You can obtain ANSICodePage by specifying System.Globalization.CultureInfo.CurrentCulture.TextInfo.ANSICodePage
.
ChrW
는 CharCode
유니코드 코드 포인트를 사용 합니다.ChrW
takes CharCode
as a Unicode code point. 범위는 현재 스레드에 대 한 문화권 및 코드 페이지 설정에 독립적입니다.The range is independent of the culture and code page settings for the current thread. -32768부터-1 까지의 값은 + 32768 ~ + 65535 범위의 값과 동일 하 게 처리 됩니다.Values from -32768 through -1 are treated the same as values in the range +32768 through +65535.
0에서 31 사이의 숫자는 표준가 아닌 ASCII 코드와 동일 합니다.Numbers from 0 through 31 are the same as standard nonprintable ASCII codes. 예를 들어는 Chr(10)
줄 바꿈 문자를 반환 합니다.For example, Chr(10)
returns a line feed character.
참고
ChrB
이전 버전의 Visual Basic에서 함수는 단일 바이트를 반환 합니다.The ChrB
function in earlier versions of Visual Basic returns a single byte. 더블 바이트 문자 집합 (DBCS) 애플리케이션의 문자열을 변환에 주로 사용 됩니다.It is used primarily for converting strings in double-byte character set (DBCS) applications. Visual Basic 및 .NET Framework의 모든 문자열은 유니코드 이며 ChrB
더 이상 지원 되지 않습니다.All strings in Visual Basic and the .NET Framework are in Unicode, and ChrB
is no longer supported.