Char.IsSurrogate 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
문자에 서로게이트 코드 단위가 있는지 여부를 나타냅니다.
오버로드
| IsSurrogate(Char) |
지정된 문자에 서로게이트 코드 단위가 있는지 여부를 나타냅니다. |
| IsSurrogate(String, Int32) |
지정된 문자열의 지정된 위치에 있는 문자에 서로게이트 코드 단위가 있는지 여부를 나타냅니다. |
예제
다음 예제는 IsSurrogate 메서드.
using namespace System;
int main()
{
// - escape params specifying Unicode not implemented in v7.0
Console::WriteLine( Char::IsSurrogate( 'a' ) ); // Output: "False"
}
using System;
public class IsSurrogateSample {
public static void Main() {
string str = "\U00010F00"; // Unicode values between 0x10000 and 0x10FFF are represented by two 16-bit "surrogate" characters
Console.WriteLine(Char.IsSurrogate('a')); // Output: "False"
Console.WriteLine(Char.IsSurrogate(str, 0)); // Output: "True"
}
}
open System
let str = "\U00010F00" // Unicode values between 0x10000 and 0x10FFF are represented by two 16-bit "surrogate" characters
printfn $"{Char.IsSurrogate 'a'}" // Output: "False"
printfn $"{Char.IsSurrogate(str, 0)}" // Output: "True"
Module IsSurrogateSample
Sub Main()
' NOTE: Visual Basic doesn't give us a way to create a 32-bit Unicode
' character composed of two 16-bit surrogate values, so a case where
' IsSurrogate returns True cannot be included in this sample.
Console.WriteLine(Char.IsSurrogate("a"c)) ' Output: "False"
End Sub
End Module
IsSurrogate(Char)
지정된 문자에 서로게이트 코드 단위가 있는지 여부를 나타냅니다.
public:
static bool IsSurrogate(char c);
public static bool IsSurrogate (char c);
static member IsSurrogate : char -> bool
Public Shared Function IsSurrogate (c As Char) As Boolean
매개 변수
- c
- Char
평가할 유니코드 문자입니다.
반환
c가 상위 서로게이트 또는 하위 서로게이트이면 true이고, 그렇지 않으면 false입니다.
설명
서로게이트는 Char u + d 800 u + DFFF 까지의 범위에 있는 utf-16 코드 단위를 포함 하는 개체입니다. 이 범위에서 코드 단위가 있는 각 문자는 범주에 속합니다 UnicodeCategory.Surrogate . 개별 서로게이트 코드 단위는 자체적으로 해석 되지 않지만 서로게이트 쌍의 일부로 사용 되는 경우에만 의미가 있습니다. 서로게이트 쌍에 대 한 자세한 내용은 유니코드 홈페이지에서 유니코드 표준을 참조 하세요.
추가 정보
적용 대상
IsSurrogate(String, Int32)
지정된 문자열의 지정된 위치에 있는 문자에 서로게이트 코드 단위가 있는지 여부를 나타냅니다.
public:
static bool IsSurrogate(System::String ^ s, int index);
public static bool IsSurrogate (string s, int index);
static member IsSurrogate : string * int -> bool
Public Shared Function IsSurrogate (s As String, index As Integer) As Boolean
매개 변수
- s
- String
문자열
- index
- Int32
s에서 평가할 문자의 위치입니다.
반환
index에서 s 위치에 있는 문자가 상위 서로게이트 또는 하위 서로게이트이면 true이고, 그렇지 않으면 false입니다.
예외
s이(가) null인 경우
index가 0보다 작거나 s의 마지막 위치보다 큽니다.
설명
문자열의 문자 위치는 0부터 시작 하는 인덱스입니다.
서로게이트는 Char u + d 800 u + DFFF 까지의 범위에 있는 utf-16 코드 단위를 포함 하는 개체입니다. 이 범위에서 코드 단위가 있는 각 문자는 범주에 속합니다 UnicodeCategory.Surrogate . 개별 서로게이트 코드 단위는 자체적으로 해석 되지 않지만 서로게이트 쌍의 일부로 사용 되는 경우에만 의미가 있습니다. 서로게이트 쌍에 대 한 자세한 내용은 유니코드 홈페이지에서 유니코드 표준을 참조 하세요.