Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <a href="http://msdn.microsoft.com/en-us/library/system.string.aspx" rel="noreferrer"><code>string</code></a> class represents a UTF-16 encoded block of text, and each <a href="http://msdn.microsoft.com/en-us/library/system.char.aspx" rel="noreferrer"><code>char</code></a> in a <code>string</code> represents a UTF-16 code value.</p> <p>Although there is no BCL type that represents a single Unicode code point, there is support for Unicode characters beyond Plane 0 in the form of method overloads taking a <code>string</code> and an index instead of just a <code>char</code>. For example, the static <a href="http://msdn.microsoft.com/en-us/library/h6sx68ke.aspx" rel="noreferrer"><code>GetUnicodeCategory</code>&#xfeff;<code>(char)</code></a> method on the <a href="http://msdn.microsoft.com/en-us/library/system.globalization.charunicodeinfo.aspx" rel="noreferrer">System.Globalization.CharUnicodeInfo</a> class has a corresponding <a href="http://msdn.microsoft.com/en-us/library/a91e3zb6.aspx" rel="noreferrer"><code>GetUnicodeCategory</code>&#xfeff;<code>(string,int)</code></a> method that will recognize a simple character or a surrogate pair starting at the specified index.</p> <hr> <p>To iterate through the text elements in a <code>string</code>, you can use the methods on the <a href="http://msdn.microsoft.com/en-us/library/system.globalization.stringinfo.aspx" rel="noreferrer">System.Globalization.StringInfo</a> class. Here, a "text element" corresponds to a single character as displayed on screen. This means that simple characters (<code>"a"</code>), combining characters (<code>"a\u0304\u0308"</code> = "a&#x0304;&#x0308;"), and surrogate pairs (<code>"\uD950\uDF21"</code> = "&#xD950;&#xDF21;") will all be treated as a single text element.</p> <p>Specifically, the <a href="http://msdn.microsoft.com/en-us/library/x2f3k4f6.aspx" rel="noreferrer">GetTextElementEnumerator</a> static method will allow you to enumerate over each text element in a <code>string</code> (see the linked MSDN page for a code example).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload