mscorlib(4.0.0.0) API with additions
System.Globalization.StringInfo Class Reference

Provides functionality to split a string into text elements and to iterate through those text elements. More...

Public Member Functions

 StringInfo ()
 Initializes a new instance of the T:System.Globalization.StringInfo class. More...
 
 StringInfo (string value)
 Initializes a new instance of the T:System.Globalization.StringInfo class to a specified string. More...
 
override bool Equals (object value)
 Indicates whether the current T:System.Globalization.StringInfo object is equal to a specified object. More...
 
override int GetHashCode ()
 Calculates a hash code for the value of the current T:System.Globalization.StringInfo object. More...
 
string SubstringByTextElements (int startingTextElement)
 Retrieves a substring of text elements from the current T:System.Globalization.StringInfo object starting from a specified text element and continuing through the last text element. More...
 
string SubstringByTextElements (int startingTextElement, int lengthInTextElements)
 Retrieves a substring of text elements from the current T:System.Globalization.StringInfo object starting from a specified text element and continuing through the specified number of text elements. More...
 

Static Public Member Functions

static string GetNextTextElement (string str)
 Gets the first text element in a specified string. More...
 
static string GetNextTextElement (string str, int index)
 Gets the text element at the specified index of the specified string. More...
 
static TextElementEnumerator GetTextElementEnumerator (string str)
 Returns an enumerator that iterates through the text elements of the entire string. More...
 
static TextElementEnumerator GetTextElementEnumerator (string str, int index)
 Returns an enumerator that iterates through the text elements of the string, starting at the specified index. More...
 
static int [] ParseCombiningCharacters (string str)
 Returns the indexes of each base character, high surrogate, or control character within the specified string. More...
 

Properties

string String [get, set]
 Gets or sets the value of the current T:System.Globalization.StringInfo object. More...
 
int LengthInTextElements [get]
 Gets the number of text elements in the current T:System.Globalization.StringInfo object. More...
 

Detailed Description

Provides functionality to split a string into text elements and to iterate through those text elements.

Definition at line 10 of file StringInfo.cs.

Constructor & Destructor Documentation

◆ StringInfo() [1/2]

System.Globalization.StringInfo.StringInfo ( )

Initializes a new instance of the T:System.Globalization.StringInfo class.

Definition at line 71 of file StringInfo.cs.

◆ StringInfo() [2/2]

System.Globalization.StringInfo.StringInfo ( string  value)

Initializes a new instance of the T:System.Globalization.StringInfo class to a specified string.

Parameters
valueA string to initialize this T:System.Globalization.StringInfo object.
Exceptions
T:System.ArgumentNullExceptionvalue is null.

Definition at line 81 of file StringInfo.cs.

Member Function Documentation

◆ Equals()

override bool System.Globalization.StringInfo.Equals ( object  value)

Indicates whether the current T:System.Globalization.StringInfo object is equal to a specified object.

Parameters
valueAn object.
Returns
true if the value parameter is a T:System.Globalization.StringInfo object and its P:System.Globalization.StringInfo.String property equals the P:System.Globalization.StringInfo.String property of this T:System.Globalization.StringInfo object; otherwise, false.

Definition at line 107 of file StringInfo.cs.

◆ GetHashCode()

override int System.Globalization.StringInfo.GetHashCode ( )

Calculates a hash code for the value of the current T:System.Globalization.StringInfo object.

Returns
A 32-bit signed integer hash code based on the string value of this T:System.Globalization.StringInfo object.

Definition at line 121 of file StringInfo.cs.

◆ GetNextTextElement() [1/2]

static string System.Globalization.StringInfo.GetNextTextElement ( string  str)
static

Gets the first text element in a specified string.

Parameters
strThe string from which to get the text element.
Returns
A string containing the first text element in the specified string.
Exceptions
T:System.ArgumentNullExceptionstr is null.

Definition at line 185 of file StringInfo.cs.

◆ GetNextTextElement() [2/2]

static string System.Globalization.StringInfo.GetNextTextElement ( string  str,
int  index 
)
static

Gets the text element at the specified index of the specified string.

Parameters
strThe string from which to get the text element.
indexThe zero-based index at which the text element starts.
Returns
A string containing the text element at the specified index of the specified string.
Exceptions
T:System.ArgumentNullExceptionstr is null.
T:System.ArgumentOutOfRangeExceptionindex is outside the range of valid indexes for str .

Definition at line 227 of file StringInfo.cs.

◆ GetTextElementEnumerator() [1/2]

static TextElementEnumerator System.Globalization.StringInfo.GetTextElementEnumerator ( string  str)
static

Returns an enumerator that iterates through the text elements of the entire string.

Parameters
strThe string to iterate through.
Returns
A T:System.Globalization.TextElementEnumerator for the entire string.
Exceptions
T:System.ArgumentNullExceptionstr is null.

Definition at line 253 of file StringInfo.cs.

◆ GetTextElementEnumerator() [2/2]

static TextElementEnumerator System.Globalization.StringInfo.GetTextElementEnumerator ( string  str,
int  index 
)
static

Returns an enumerator that iterates through the text elements of the string, starting at the specified index.

Parameters
strThe string to iterate through.
indexThe zero-based index at which to start iterating.
Returns
A T:System.Globalization.TextElementEnumerator for the string starting at index .
Exceptions
T:System.ArgumentNullExceptionstr is null.
T:System.ArgumentOutOfRangeExceptionindex is outside the range of valid indexes for str .

Definition at line 267 of file StringInfo.cs.

◆ ParseCombiningCharacters()

static int [] System.Globalization.StringInfo.ParseCombiningCharacters ( string  str)
static

Returns the indexes of each base character, high surrogate, or control character within the specified string.

Parameters
strThe string to search.
Returns
An array of integers that contains the zero-based indexes of each base character, high surrogate, or control character within the specified string.
Exceptions
T:System.ArgumentNullExceptionstr is null.

Definition at line 287 of file StringInfo.cs.

◆ SubstringByTextElements() [1/2]

string System.Globalization.StringInfo.SubstringByTextElements ( int  startingTextElement)

Retrieves a substring of text elements from the current T:System.Globalization.StringInfo object starting from a specified text element and continuing through the last text element.

Parameters
startingTextElementThe zero-based index of a text element in this T:System.Globalization.StringInfo object.
Returns
A substring of text elements in this T:System.Globalization.StringInfo object, starting from the text element index specified by the startingTextElement parameter and continuing through the last text element in this object.
Exceptions
T:System.ArgumentOutOfRangeExceptionstartingTextElement is less than zero.-or-The string that is the value of the current T:System.Globalization.StringInfo object is the empty string ("").

Definition at line 131 of file StringInfo.cs.

◆ SubstringByTextElements() [2/2]

string System.Globalization.StringInfo.SubstringByTextElements ( int  startingTextElement,
int  lengthInTextElements 
)

Retrieves a substring of text elements from the current T:System.Globalization.StringInfo object starting from a specified text element and continuing through the specified number of text elements.

Parameters
startingTextElementThe zero-based index of a text element in this T:System.Globalization.StringInfo object.
lengthInTextElementsThe number of text elements to retrieve.
Returns
A substring of text elements in this T:System.Globalization.StringInfo object. The substring consists of the number of text elements specified by the lengthInTextElements parameter and starts from the text element index specified by the startingTextElement parameter.
Exceptions
T:System.ArgumentOutOfRangeExceptionstartingTextElement is less than zero.-or- startingTextElement is greater than or equal to the length of the string that is the value of the current T:System.Globalization.StringInfo object.-or- lengthInTextElements is less than zero.-or-The string that is the value of the current T:System.Globalization.StringInfo object is the empty string ("").-or- startingTextElement + lengthInTextElements specify an index that is greater than the number of text elements in this T:System.Globalization.StringInfo object.

Definition at line 153 of file StringInfo.cs.

Property Documentation

◆ LengthInTextElements

int System.Globalization.StringInfo.LengthInTextElements
get

Gets the number of text elements in the current T:System.Globalization.StringInfo object.

Returns
The number of base characters, surrogate pairs, and combining character sequences in this T:System.Globalization.StringInfo object.

Definition at line 57 of file StringInfo.cs.

◆ String

string System.Globalization.StringInfo.String
getset

Gets or sets the value of the current T:System.Globalization.StringInfo object.

Returns
The string that is the value of the current T:System.Globalization.StringInfo object.
Exceptions
T:System.ArgumentNullExceptionThe value in a set operation is null.

Definition at line 35 of file StringInfo.cs.


The documentation for this class was generated from the following file: