9 [__DynamicallyInvokable]
12 [OptionalField(VersionAdded = 2)]
16 private int[] m_indexes;
33 [__DynamicallyInvokable]
36 [__DynamicallyInvokable]
41 [__DynamicallyInvokable]
55 [__DynamicallyInvokable]
58 [__DynamicallyInvokable]
65 return Indexes.Length;
70 [__DynamicallyInvokable]
80 [__DynamicallyInvokable]
95 if (m_str.Length == 0)
106 [__DynamicallyInvokable]
107 public override bool Equals(
object value)
110 if (stringInfo !=
null)
112 return m_str.Equals(stringInfo.m_str);
120 [__DynamicallyInvokable]
123 return m_str.GetHashCode();
135 if (startingTextElement < 0)
155 if (startingTextElement < 0)
159 if (
String.
Length == 0 || startingTextElement >= Indexes.Length)
163 if (lengthInTextElements < 0)
167 if (startingTextElement > Indexes.Length - lengthInTextElements)
171 int num = Indexes[startingTextElement];
172 if (startingTextElement + lengthInTextElements == Indexes.Length)
176 return String.
Substring(num, Indexes[lengthInTextElements + startingTextElement] - num);
184 [__DynamicallyInvokable]
190 internal static int GetCurrentTextElementLen(
string str,
int index,
int len, ref
UnicodeCategory ucCurrent, ref
int currentCharCount)
192 if (index + currentCharCount == len)
194 return currentCharCount;
196 UnicodeCategory unicodeCategory = CharUnicodeInfo.InternalGetUnicodeCategory(str, index + currentCharCount, out
int charLength);
200 for (index += currentCharCount + charLength; index < len; index += charLength)
202 unicodeCategory = CharUnicodeInfo.InternalGetUnicodeCategory(str, index, out charLength);
203 if (!CharUnicodeInfo.IsCombiningCategory(unicodeCategory))
205 ucCurrent = unicodeCategory;
206 currentCharCount = charLength;
212 int result = currentCharCount;
213 ucCurrent = unicodeCategory;
214 currentCharCount = charLength;
226 [__DynamicallyInvokable]
233 int length = str.Length;
234 if (index < 0 || index >= length)
244 return str.Substring(index, GetCurrentTextElementLen(str, index, length, ref ucCurrent, ref charLength));
252 [__DynamicallyInvokable]
266 [__DynamicallyInvokable]
273 int length = str.Length;
274 if (index < 0 || index > length)
286 [__DynamicallyInvokable]
293 int length = str.Length;
294 int[] array =
new int[length];
302 for (
UnicodeCategory ucCurrent =
CharUnicodeInfo.InternalGetUnicodeCategory(str, 0, out charLength); i < length; i += GetCurrentTextElementLen(str, i, length, ref ucCurrent, ref charLength))
308 int[] array2 =
new int[num];
override bool Equals(object value)
Indicates whether the current T:System.Globalization.StringInfo object is equal to a specified object...
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Represents text as a sequence of UTF-16 code units.To browse the .NET Framework source code for this ...
StringInfo(string value)
Initializes a new instance of the T:System.Globalization.StringInfo class to a specified string.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
static TextElementEnumerator GetTextElementEnumerator(string str, int index)
Returns an enumerator that iterates through the text elements of the string, starting at the specifie...
string Substring(int startIndex)
Retrieves a substring from this instance. The substring starts at a specified character position and ...
static int [] ParseCombiningCharacters(string str)
Returns the indexes of each base character, high surrogate, or control character within the specified...
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Provides functionality to split a string into text elements and to iterate through those text element...
int LengthInTextElements
Gets the number of text elements in the current T:System.Globalization.StringInfo object.
Provides information about, and means to manipulate, the current environment and platform....
Enumerates the text elements of a string.
static string GetNextTextElement(string str, int index)
Gets the text element at the specified index of the specified string.
static string GetNextTextElement(string str)
Gets the first text element in a specified string.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
string SubstringByTextElements(int startingTextElement)
Retrieves a substring of text elements from the current T:System.Globalization.StringInfo object star...
string SubstringByTextElements(int startingTextElement, int lengthInTextElements)
Retrieves a substring of text elements from the current T:System.Globalization.StringInfo object star...
Retrieves information about a Unicode character. This class cannot be inherited.
static void Copy(Array sourceArray, Array destinationArray, int length)
Copies a range of elements from an T:System.Array starting at the first element and pastes them into ...
static TextElementEnumerator GetTextElementEnumerator(string str)
Returns an enumerator that iterates through the text elements of the entire string.
UnicodeCategory
Defines the Unicode category of a character.
StringInfo()
Initializes a new instance of the T:System.Globalization.StringInfo class.
Specifies that the class can be serialized.
override int GetHashCode()
Calculates a hash code for the value of the current T:System.Globalization.StringInfo object.
int Length
Gets the number of characters in the current T:System.String object.