Export (0) Print
Expand All

StringInfo.SubstringByTextElements Method (Int32)

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

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

public string SubstringByTextElements(
	int startingTextElement
)

Parameters

startingTextElement
Type: System.Int32

The zero-based index of a text element in this StringInfo object.

Return Value

Type: System.String
A substring of text elements in this StringInfo object, starting from the text element index specified by the startingTextElement parameter and continuing through the last text element in this object.

ExceptionCondition
ArgumentOutOfRangeException

startingTextElement is less than zero.

-or-

The string that is the value of the current StringInfo object is the empty string ("").

Consider a string that consists of five text elements, indexed from 0 through 4. If the startingTextElement parameter is 1, the SubstringByTextElements method returns a substring that consists of the text elements for which the indexes are 1, 2, 3, and 4.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft