StringInfo StringInfo StringInfo StringInfo Class

Definition

문자열을 텍스트 요소로 분할하고 해당 텍스트 요소를 통해 반복하는 기능을 제공합니다. Provides functionality to split a string into text elements and to iterate through those text elements.

public ref class StringInfo
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
public class StringInfo
type StringInfo = class
Public Class StringInfo
Inheritance
StringInfoStringInfoStringInfoStringInfo
Attributes
ComVisibleAttribute SerializableAttribute

Examples

<span data-ttu-id="d481a-126">이 예제에서는 합니다 <xref:System.Globalization.StringInfo.GetTextElementEnumerator%2A> 및 <xref:System.Globalization.StringInfo.ParseCombiningCharacters%2A> 의 메서드는 <xref:System.Globalization.StringInfo> 서로게이트 및 결합 문자를 포함 하는 문자열을 조작 하는 클래스입니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-126">This example uses the <xref:System.Globalization.StringInfo.GetTextElementEnumerator%2A> and <xref:System.Globalization.StringInfo.ParseCombiningCharacters%2A> methods of the <xref:System.Globalization.StringInfo> class to manipulate a string that contains surrogate and combining characters.</span></span>

using namespace System;
using namespace System::Text;
using namespace System::Globalization;


// Show how to enumerate each real character (honoring surrogates)
// in a string.

void EnumTextElements(String^ combiningChars)
{
    // This StringBuilder holds the output results.
    StringBuilder^ sb = gcnew StringBuilder();

    // Use the enumerator returned from GetTextElementEnumerator
    // method to examine each real character.
    TextElementEnumerator^ charEnum =
        StringInfo::GetTextElementEnumerator(combiningChars);
    while (charEnum->MoveNext())
    {
        sb->AppendFormat("Character at index {0} is '{1}'{2}", 
            charEnum->ElementIndex, charEnum->GetTextElement(), 
            Environment::NewLine);
    }

    // Show the results.
    Console::WriteLine("Result of GetTextElementEnumerator:");
    Console::WriteLine(sb);
}


// Show how to discover the index of each real character
// (honoring surrogates) in a string.

void EnumTextElementIndexes(String^ combiningChars)
{
    // This StringBuilder holds the output results.
    StringBuilder^ sb = gcnew StringBuilder();

    // Use the ParseCombiningCharacters method to
    // get the index of each real character in the string.
    array <int>^ textElemIndex =
        StringInfo::ParseCombiningCharacters(combiningChars);

    // Iterate through each real character showing the character
    // and the index where it was found.
    for (int i = 0; i < textElemIndex->Length; i++)
    {
        sb->AppendFormat("Character {0} starts at index {1}{2}",
            i, textElemIndex[i], Environment::NewLine);
    }

    // Show the results.
    Console::WriteLine("Result of ParseCombiningCharacters:");
    Console::WriteLine(sb);
}

int main()
{

    // The string below contains combining characters.
    String^ combiningChars = L"a\u0304\u0308bc\u0327";

    // Show each 'character' in the string.
    EnumTextElements(combiningChars);

    // Show the index in the string where each 'character' starts.
    EnumTextElementIndexes(combiningChars);

};

// This code produces the following output.
//
// Result of GetTextElementEnumerator:
// Character at index 0 is 'a-"'
// Character at index 3 is 'b'
// Character at index 4 is 'c,'
//
// Result of ParseCombiningCharacters:
// Character 0 starts at index 0
// Character 1 starts at index 3
// Character 2 starts at index 4
using System;
using System.Text;
using System.Globalization;

public sealed class App {
   static void Main() {
      // The string below contains combining characters.
      String s = "a\u0304\u0308bc\u0327";

      // Show each 'character' in the string.
      EnumTextElements(s);

      // Show the index in the string where each 'character' starts.
      EnumTextElementIndexes(s);
   }

   // Show how to enumerate each real character (honoring surrogates) in a string.
   static void EnumTextElements(String s) {
      // This StringBuilder holds the output results.
      StringBuilder sb = new StringBuilder();

      // Use the enumerator returned from GetTextElementEnumerator 
      // method to examine each real character.
      TextElementEnumerator charEnum = StringInfo.GetTextElementEnumerator(s);
      while (charEnum.MoveNext()) {
         sb.AppendFormat(
           "Character at index {0} is '{1}'{2}",
           charEnum.ElementIndex, charEnum.GetTextElement(),
           Environment.NewLine);
      }

      // Show the results.
      Console.WriteLine("Result of GetTextElementEnumerator:");
      Console.WriteLine(sb);
   }

   // Show how to discover the index of each real character (honoring surrogates) in a string.
   static void EnumTextElementIndexes(String s) {
      // This StringBuilder holds the output results.
      StringBuilder sb = new StringBuilder();

      // Use the ParseCombiningCharacters method to 
      // get the index of each real character in the string.
      Int32[] textElemIndex = StringInfo.ParseCombiningCharacters(s);

      // Iterate through each real character showing the character and the index where it was found.
      for (Int32 i = 0; i < textElemIndex.Length; i++) {
         sb.AppendFormat(
            "Character {0} starts at index {1}{2}",
            i, textElemIndex[i], Environment.NewLine);
      }

      // Show the results.
      Console.WriteLine("Result of ParseCombiningCharacters:");
      Console.WriteLine(sb);
   }
}

// This code produces the following output.
//
// Result of GetTextElementEnumerator:
// Character at index 0 is 'a-"'
// Character at index 3 is 'b'
// Character at index 4 is 'c,'
// 
// Result of ParseCombiningCharacters:
// Character 0 starts at index 0
// Character 1 starts at index 3
// Character 2 starts at index 4
Imports System.Text
Imports System.Globalization

Public Module Example
   Public Sub Main()
      ' The string below contains combining characters.
      Dim s As String = "a" + ChrW(&h0304) + ChrW(&h0308) + "bc" + ChrW(&h0327)

      ' Show each 'character' in the string.
      EnumTextElements(s)

      ' Show the index in the string where each 'character' starts.
      EnumTextElementIndexes(s)
   End Sub

   ' Show how to enumerate each real character (honoring surrogates) in a string.
   Sub EnumTextElements(s As String)
      ' This StringBuilder holds the output results.
      Dim sb As New StringBuilder()

      ' Use the enumerator returned from GetTextElementEnumerator 
      ' method to examine each real character.
      Dim charEnum As TextElementEnumerator = StringInfo.GetTextElementEnumerator(s)
      Do While charEnum.MoveNext()
         sb.AppendFormat("Character at index {0} is '{1}'{2}",
                         charEnum.ElementIndex, 
                         charEnum.GetTextElement(),
                         Environment.NewLine)
      Loop

      ' Show the results.
      Console.WriteLine("Result of GetTextElementEnumerator:")
      Console.WriteLine(sb)
   End Sub

   ' Show how to discover the index of each real character (honoring surrogates) in a string.
   Sub EnumTextElementIndexes(s As String)
      ' This StringBuilder holds the output results.
      Dim sb As New StringBuilder()

      ' Use the ParseCombiningCharacters method to 
      ' get the index of each real character in the string.
      Dim textElemIndex() As Integer = StringInfo.ParseCombiningCharacters(s)

      ' Iterate through each real character showing the character and the index where it was found.
      For i As Int32 = 0 To textElemIndex.Length - 1
         sb.AppendFormat("Character {0} starts at index {1}{2}",
                         i, textElemIndex(i), Environment.NewLine)
      Next

      ' Show the results.
      Console.WriteLine("Result of ParseCombiningCharacters:")
      Console.WriteLine(sb)
   End Sub
End Module
' The example displays the following output:
'       Result of GetTextElementEnumerator:
'       Character at index 0 is 'a-"'
'       Character at index 3 is 'b'
'       Character at index 4 is 'c,'
'       
'       Result of ParseCombiningCharacters:
'       Character 0 starts at index 0
'       Character 1 starts at index 3
'       Character 2 starts at index 4

Sorting Weight Tables for Windows operating systems

Remarks

<span data-ttu-id="d481a-102">.NET의 문자 소 즉, 단일 문자로 표시 되는 텍스트 단위로 텍스트 요소를 정의 합니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-102">.NET defines a text element as a unit of text that is displayed as a single character, that is, a grapheme.</span></span> <span data-ttu-id="d481a-103">텍스트 요소는 기본 문자, 서로게이트 쌍 또는 결합 문자 시퀀스입니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-103">A text element can be a base character, a surrogate pair, or a combining character sequence.</span></span> <span data-ttu-id="d481a-104">합니다 유니코드 표준 여기서 첫 번째 단위 쌍의 high surrogate 인지 하 고 두 번째는 낮은 두 명의 코드 단위 시퀀스를 구성 하는 단일 추상 문자에 대 한 코드 문자 표현으로 서로게이트 쌍을 정의 합니다. 서로게이트입니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-104">The Unicode Standard defines a surrogate pair as a coded character representation for a single abstract character that consists of a sequence of two code units, where the first unit of the pair is a high surrogate and the second is a low surrogate.</span></span> <span data-ttu-id="d481a-105">유니코드 표준 정의 결합 문자 시퀀스는 기본 문자와 조합 문자를 하나 이상의 조합으로 합니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-105">The Unicode Standard defines a combining character sequence as a combination of a base character and one or more combining characters.</span></span> <span data-ttu-id="d481a-106">기본 문자 또는 조합 문자에 서로게이트 쌍을 나타낼 수 있습니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-106">A surrogate pair can represent a base character or a combining character.</span></span>

<span data-ttu-id="d481a-107">합니다 <xref:System.Globalization.StringInfo> 클래스를 사용 하면 일련의 개별 아니라 텍스트 요소는 문자열을 사용 하 여 작업 <xref:System.Char> 개체입니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-107">The <xref:System.Globalization.StringInfo> class enables you to work with a string as a series of textual elements rather than individual <xref:System.Char> objects.</span></span>

<span data-ttu-id="d481a-108">인스턴스화하는 <xref:System.Globalization.StringInfo> 지정된 된 문자열을 나타내는 개체 다음 중 하나를 수행할 수 있습니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-108">To instantiate a <xref:System.Globalization.StringInfo> object that represents a specified string, you can do either of the following:</span></span>

  • <span data-ttu-id="d481a-109">호출을 <xref:System.Globalization.StringInfo.%23ctor%28System.String%29> 생성자 문자열을 전달 하는 <xref:System.Globalization.StringInfo> 개체가 인수로로 나타낼 수입니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-109">Call the <xref:System.Globalization.StringInfo.%23ctor%28System.String%29> constructor and pass it the string that the <xref:System.Globalization.StringInfo> object is to represent as an argument.</span></span>

  • <span data-ttu-id="d481a-110">기본값을 호출 <xref:System.Globalization.StringInfo.%23ctor> 생성자에 문자열을 할당 합니다 <xref:System.Globalization.StringInfo> 개체가 나타내기 위해는 <xref:System.Globalization.StringInfo.String%2A> 속성.</span><span class="sxs-lookup"><span data-stu-id="d481a-110">Call the default <xref:System.Globalization.StringInfo.%23ctor> constructor, and assign the string that the <xref:System.Globalization.StringInfo> object is to represent to the <xref:System.Globalization.StringInfo.String%2A> property.</span></span>

<span data-ttu-id="d481a-111">두 가지 방법으로 문자열의 개별 텍스트 요소를 사용 하 여 작업할 수 있습니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-111">You can work with the individual text elements in a string in two ways:</span></span>

  • <span data-ttu-id="d481a-112">각 텍스트 요소를 열거 합니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-112">By enumerating each text element.</span></span> <span data-ttu-id="d481a-113">호출 하면이 작업을 수행 하는 <xref:System.Globalization.StringInfo.GetTextElementEnumerator%2A> 메서드를 반복적으로 호출 합니다 <xref:System.Globalization.TextElementEnumerator.MoveNext%2A> 메서드는 반환 된 <xref:System.Globalization.TextElementEnumerator> 메서드가 반환 될 때까지 개체 false.</span><span class="sxs-lookup"><span data-stu-id="d481a-113">To do this, you call the <xref:System.Globalization.StringInfo.GetTextElementEnumerator%2A> method, and then repeatedly call the <xref:System.Globalization.TextElementEnumerator.MoveNext%2A> method on the returned <xref:System.Globalization.TextElementEnumerator> object until the method returns false.</span></span>

  • <span data-ttu-id="d481a-114">호출 하 여는 <xref:System.Globalization.StringInfo.ParseCombiningCharacters%2A> 각 텍스트 요소의 시작 하는 인덱스를 포함 하는 배열을 검색 하는 방법입니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-114">By calling the <xref:System.Globalization.StringInfo.ParseCombiningCharacters%2A> method to retrieve an array that contains the starting index of each text element.</span></span> <span data-ttu-id="d481a-115">그런 다음 이러한 인덱스를 전달 하 여 개별 텍스트 요소를 검색할 수 있습니다는 <xref:System.Globalization.StringInfo.SubstringByTextElements%2A> 메서드.</span><span class="sxs-lookup"><span data-stu-id="d481a-115">You can then retrieve individual text elements by passing these indexes to the <xref:System.Globalization.StringInfo.SubstringByTextElements%2A> method.</span></span>

<span data-ttu-id="d481a-116">다음 예제에서는 문자열에서 텍스트 요소를 사용 하는 두 가지를 보여 줍니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-116">The following example illustrates both ways of working with the text elements in a string.</span></span> <span data-ttu-id="d481a-117">두 문자열이 생성 됩니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-117">It creates two strings:</span></span>

  • <span data-ttu-id="d481a-118">strCombining에 여러 개 포함 된 세 개의 텍스트 요소를 포함 하는 아랍어 문자 문자열로 <xref:System.Char> 개체입니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-118">strCombining, which is a string of Arabic characters that includes three text elements with multiple <xref:System.Char> objects.</span></span> <span data-ttu-id="d481a-119">첫째 텍스트 요소는 아랍어 문자 ALEF 기본 문자 (U +-627) 뒤에 아래 HAMZA 아랍어 (U +-655) 및 아랍어 KASRA (U + 0650).</span><span class="sxs-lookup"><span data-stu-id="d481a-119">The first text element is the base character ARABIC LETTER ALEF (U+-627) followed by ARABIC HAMZA BELOW (U+-655) and ARABIC KASRA (U+0650).</span></span> <span data-ttu-id="d481a-120">두 번째 텍스트 요소는 아랍어 문자 스톤 (U + 0647) 뒤에 아랍어 FATHA (U +-64E).</span><span class="sxs-lookup"><span data-stu-id="d481a-120">The second text element is ARABIC LETTER HEH (U+0647) followed by ARABIC FATHA (U+-64E).</span></span> <span data-ttu-id="d481a-121">세 번째 텍스트 요소는 아랍어 LETTTER BEH (U + 0628) 뒤에 아랍어 DAMMATAN (U + 064 C).</span><span class="sxs-lookup"><span data-stu-id="d481a-121">The third text element is ARABIC LETTTER BEH (U+0628) followed by ARABIC DAMMATAN (U+064C).</span></span>

  • <span data-ttu-id="d481a-122">strSurrogates에 세 개의 서로게이트 쌍을 포함 하는 문자열: 그리스어 ACROPHONIC 5 재능 (U + 10148) 보조 Multilingual Plane Ideographic Plane, 개인 사용자 영역에서 U + F1001에서 U + 20026에서에서.</span><span class="sxs-lookup"><span data-stu-id="d481a-122">strSurrogates, which is a string that includes three surrogate pairs: GREEK ACROPHONIC FIVE TALENTS (U+10148) from the Supplementary Multilingual Plane, U+20026 from the Supplementary Ideographic Plane, and U+F1001 from the private user area.</span></span> <span data-ttu-id="d481a-123">각 문자의 utf-16 인코딩을 뒤에 하위 서로게이트 high surrogate 구성 된 서로게이트 쌍.</span><span class="sxs-lookup"><span data-stu-id="d481a-123">The UTF-16 encoding of each character is a surrogate pair that consists of a high surrogate followed by a low surrogate.</span></span>

<span data-ttu-id="d481a-124">각 문자열은 한 번 구문 분석 합니다 <xref:System.Globalization.StringInfo.ParseCombiningCharacters%2A> 메서드 및 다음는 <xref:System.Globalization.StringInfo.GetTextElementEnumerator%2A> 메서드.</span><span class="sxs-lookup"><span data-stu-id="d481a-124">Each string is parsed once by the <xref:System.Globalization.StringInfo.ParseCombiningCharacters%2A> method and then by the <xref:System.Globalization.StringInfo.GetTextElementEnumerator%2A> method.</span></span> <span data-ttu-id="d481a-125">두 메서드는 올바르게 두 문자열의 텍스트 요소를 구문 분석 하 고 구문 분석 작업의 결과 표시 합니다.</span><span class="sxs-lookup"><span data-stu-id="d481a-125">Both methods correctly parse the text elements in the two strings and display the results of the parsing operation.</span></span>

using System;
using System.Globalization;

public class Example
{
   public static void Main()
   {
      // The Unicode code points specify Arabic base characters and 
      // combining character sequences.
      string strCombining = "\u0627\u0655\u0650\u064A\u0647\u064E" +
                            "\u0627\u0628\u064C";

      // The Unicode code points specify private surrogate pairs.
      string strSurrogates = Char.ConvertFromUtf32(0x10148) +
                             Char.ConvertFromUtf32(0x20026) + "a" +
                             Char.ConvertFromUtf32(0xF1001);
      
      EnumerateTextElements(strCombining);
      EnumerateTextElements(strSurrogates);
   }

   public static void EnumerateTextElements(string str)
   {
      // Get the Enumerator.
      TextElementEnumerator teEnum = null;      

      // Parse the string using the ParseCombiningCharacters method.
      Console.WriteLine("\nParsing with ParseCombiningCharacters:");
      int[] teIndices = StringInfo.ParseCombiningCharacters(str);
      
      for (int i = 0; i < teIndices.Length; i++) {
         if (i < teIndices.Length - 1)
            Console.WriteLine("Text Element {0} ({1}..{2})= {3}", i, 
               teIndices[i], teIndices[i + 1] - 1, 
               ShowHexValues(str.Substring(teIndices[i], teIndices[i + 1] - 
                             teIndices[i])));
         else
            Console.WriteLine("Text Element {0} ({1}..{2})= {3}", i, 
               teIndices[i], str.Length - 1, 
               ShowHexValues(str.Substring(teIndices[i])));
      }
      Console.WriteLine();

      // Parse the string with the GetTextElementEnumerator method.
      Console.WriteLine("Parsing with TextElementEnumerator:");
      teEnum = StringInfo.GetTextElementEnumerator(str);

      int teCount = - 1;

      while (teEnum.MoveNext()) {
         // Displays the current element.
         // Both GetTextElement() and Current retrieve the current
         // text element. The latter returns it as an Object.
         teCount++;
         Console.WriteLine("Text Element {0} ({1}..{2})= {3}", teCount, 
            teEnum.ElementIndex, teEnum.ElementIndex + 
            teEnum.GetTextElement().Length - 1, ShowHexValues((string)(teEnum.Current)));
      }
   }
   
   private static string ShowHexValues(string s)
   {
      string hexString = "";
      foreach (var ch in s)
         hexString += String.Format("{0:X4} ", Convert.ToUInt16(ch));

      return hexString;
   }
}
// The example displays the following output:
//       Parsing with ParseCombiningCharacters:
//       Text Element 0 (0..2)= 0627 0655 0650
//       Text Element 1 (3..3)= 064A
//       Text Element 2 (4..5)= 0647 064E
//       Text Element 3 (6..6)= 0627
//       Text Element 4 (7..8)= 0628 064C
//       
//       Parsing with TextElementEnumerator:
//       Text Element 0 (0..2)= 0627 0655 0650
//       Text Element 1 (3..3)= 064A
//       Text Element 2 (4..5)= 0647 064E
//       Text Element 3 (6..6)= 0627
//       Text Element 4 (7..8)= 0628 064C
//       
//       Parsing with ParseCombiningCharacters:
//       Text Element 0 (0..1)= D800 DD48
//       Text Element 1 (2..3)= D840 DC26
//       Text Element 2 (4..4)= 0061
//       Text Element 3 (5..6)= DB84 DC01
//       
//       Parsing with TextElementEnumerator:
//       Text Element 0 (0..1)= D800 DD48
//       Text Element 1 (2..3)= D840 DC26
//       Text Element 2 (4..4)= 0061
//       Text Element 3 (5..6)= DB84 DC01
Imports System.Globalization

Public Module Example
   Public Sub Main()
      ' The Unicode code points specify Arabic base characters and 
      ' combining character sequences.
      Dim strCombining As String = ChrW(&H627) & ChrW(&h0655) + ChrW(&H650) & 
              ChrW(&H64A) & ChrW(&H647) & ChrW(&H64E) & ChrW(&H627) & 
              ChrW(&H628) & ChrW(&H64C)

      ' The Unicode code points specify private surrogate pairs.
      Dim strSurrogates As String = Char.ConvertFromUtf32(&h10148) +
                                    Char.ConvertFromUtf32(&h20026) + "a" +
                                    Char.ConvertFromUtf32(&hF1001)
      
      EnumerateTextElements(strCombining)
      EnumerateTextElements(strSurrogates)
   End Sub

   Public Sub EnumerateTextElements(str As String)
      ' Get the Enumerator.
      Dim teEnum As TextElementEnumerator = Nothing      

      ' Parse the string using the ParseCombiningCharacters method.
      Console.WriteLine()
      Console.WriteLine("Parsing with ParseCombiningCharacters:")
      Dim teIndices As Integer() = StringInfo.ParseCombiningCharacters(str)
      
      For i As Integer = 0 To teIndices.Length - 1
         If i < teIndices.Length - 1 Then
            Console.WriteLine("Text Element {0} ({1}..{2})= {3}", i, 
               TEIndices(i), TEIndices((i + 1)) - 1, 
               ShowHexValues(str.Substring(TEIndices(i), TEIndices((i + 1)) - 
                             teIndices(i))))
         Else
            Console.WriteLine("Text Element {0} ({1}..{2})= {3}", i, 
               teIndices(i), str.Length - 1, 
               ShowHexValues(str.Substring(teIndices(i))))
         End If
      Next
      Console.WriteLine()

      ' Parse the string with the GetTextElementEnumerator method.
      Console.WriteLine("Parsing with TextElementEnumerator:")
      teEnum = StringInfo.GetTextElementEnumerator(str)

      Dim TECount As Integer = - 1

      While teEnum.MoveNext()
         ' Prints the current element.
         ' Both GetTextElement() and Current retrieve the current
         ' text element. The latter returns it as an Object.
         TECount += 1
         Console.WriteLine("Text Element {0} ({1}..{2})= {3}", teCount, 
            teEnum.ElementIndex, teEnum.ElementIndex + 
            teEnum.GetTextElement().Length - 1, ShowHexValues(CStr(teEnum.Current)))
      End While
   End Sub
   
   Private Function ShowHexValues(s As String) As String
      Dim hexString As String = ""
      For Each ch In s
         hexString += String.Format("{0:X4} ", Convert.ToUInt16(ch))
      Next
      Return hexString
   End Function
End Module
' The example displays the following output:
'       Parsing with ParseCombiningCharacters:
'       Text Element 0 (0..2)= 0627 0655 0650
'       Text Element 1 (3..3)= 064A
'       Text Element 2 (4..5)= 0647 064E
'       Text Element 3 (6..6)= 0627
'       Text Element 4 (7..8)= 0628 064C
'       
'       Parsing with TextElementEnumerator:
'       Text Element 0 (0..2)= 0627 0655 0650
'       Text Element 1 (3..3)= 064A
'       Text Element 2 (4..5)= 0647 064E
'       Text Element 3 (6..6)= 0627
'       Text Element 4 (7..8)= 0628 064C
'       
'       Parsing with ParseCombiningCharacters:
'       Text Element 0 (0..1)= D800 DD48
'       Text Element 1 (2..3)= D840 DC26
'       Text Element 2 (4..4)= 0061
'       Text Element 3 (5..6)= DB84 DC01
'       
'       Parsing with TextElementEnumerator:
'       Text Element 0 (0..1)= D800 DD48
'       Text Element 1 (2..3)= D840 DC26
'       Text Element 2 (4..4)= 0061
'       Text Element 3 (5..6)= DB84 DC01

Notes to Callers

메서드를 내부적으로 StringInfo 클래스의 메서드를 호출 합니다 CharUnicodeInfo 문자 범주를 결정 하는 클래스입니다. Internally, the methods of the StringInfo class call the methods of the CharUnicodeInfo class to determine character categories. .NET Framework 4.6.2 부터는 문자 분류 기반 유니코드 표준, 버전 8.0.0합니다. Starting with the .NET Framework 4.6.2, character classification is based on The Unicode Standard, Version 8.0.0. 기반.NET Framework 4.6.1 통해.NET Framework 4에 대 한 유니코드 표준, 버전 6.3.0합니다. For the .NET Framework 4 through the .NET Framework 4.6.1, it is based on The Unicode Standard, Version 6.3.0. 기반.NET core에서 유니코드 표준, 버전 8.0.0합니다. In .NET Core, it is based on The Unicode Standard, Version 8.0.0.

Constructors

StringInfo() StringInfo() StringInfo() StringInfo()

StringInfo 클래스의 새 인스턴스를 초기화합니다. Initializes a new instance of the StringInfo class.

StringInfo(String) StringInfo(String) StringInfo(String) StringInfo(String)

지정된 문자열로 StringInfo 클래스의 새 인스턴스를 초기화합니다. Initializes a new instance of the StringInfo class to a specified string.

Properties

LengthInTextElements LengthInTextElements LengthInTextElements LengthInTextElements

현재 StringInfo 개체의 텍스트 요소 수를 가져옵니다. Gets the number of text elements in the current StringInfo object.

String String String String

현재 StringInfo 개체의 값을 가져오거나 설정합니다. Gets or sets the value of the current StringInfo object.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

현재 StringInfo 개체가 지정된 개체와 같은지 여부를 나타냅니다. Indicates whether the current StringInfo object is equal to a specified object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

현재 StringInfo 개체의 값에 대한 해시 코드를 계산합니다. Calculates a hash code for the value of the current StringInfo object.

GetNextTextElement(String) GetNextTextElement(String) GetNextTextElement(String) GetNextTextElement(String)

지정된 문자열에 있는 첫째 텍스트 요소를 가져옵니다. Gets the first text element in a specified string.

GetNextTextElement(String, Int32) GetNextTextElement(String, Int32) GetNextTextElement(String, Int32) GetNextTextElement(String, Int32)

지정된 문자열의 지정된 인덱스에 있는 텍스트 요소를 가져옵니다. Gets the text element at the specified index of the specified string.

GetTextElementEnumerator(String) GetTextElementEnumerator(String) GetTextElementEnumerator(String) GetTextElementEnumerator(String)

전체 문자열의 텍스트 요소를 반복하는 열거자를 반환합니다. Returns an enumerator that iterates through the text elements of the entire string.

GetTextElementEnumerator(String, Int32) GetTextElementEnumerator(String, Int32) GetTextElementEnumerator(String, Int32) GetTextElementEnumerator(String, Int32)

지정된 인덱스에서 시작하여 문자열의 텍스트 요소를 반복하는 열거자를 반환합니다. Returns an enumerator that iterates through the text elements of the string, starting at the specified index.

GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다. Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다. Creates a shallow copy of the current Object.

(Inherited from Object)
ParseCombiningCharacters(String) ParseCombiningCharacters(String) ParseCombiningCharacters(String) ParseCombiningCharacters(String)

지정된 문자열 내에 있는 각 기본 문자, 상위 서로게이트 또는 제어 문자를 반환합니다. Returns the indexes of each base character, high surrogate, or control character within the specified string.

SubstringByTextElements(Int32) SubstringByTextElements(Int32) SubstringByTextElements(Int32) SubstringByTextElements(Int32)

현재 StringInfo 개체에서, 지정된 텍스트 요소에서 시작하여 마지막 텍스트 요소까지 계속되는 텍스트 요소의 부분 문자열을 검색합니다. Retrieves a substring of text elements from the current StringInfo object starting from a specified text element and continuing through the last text element.

SubstringByTextElements(Int32, Int32) SubstringByTextElements(Int32, Int32) SubstringByTextElements(Int32, Int32) SubstringByTextElements(Int32, Int32)

현재 StringInfo 개체에서, 지정된 텍스트 요소에서 시작하여 지정된 수의 텍스트 요소까지 계속되는 텍스트 요소의 부분 문자열을 가져옵니다. Retrieves a substring of text elements from the current StringInfo object starting from a specified text element and continuing through the specified number of text elements.

ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다. Returns a string that represents the current object.

(Inherited from Object)

Applies to

See Also