Compartilhar via


ITextSnapshot.ToCharArray Method

Converts a range of text to a character array.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

'Declaration
Function ToCharArray ( _
    startIndex As Integer, _
    length As Integer _
) As Char()
char[] ToCharArray(
    int startIndex,
    int length
)
array<wchar_t>^ ToCharArray(
    int startIndex, 
    int length
)
abstract ToCharArray : 
        startIndex:int * 
        length:int -> char[] 
function ToCharArray(
    startIndex : int, 
    length : int
) : char[]

Parameters

  • startIndex
    Type: Int32

    The starting index of the range of text.

  • length
    Type: Int32

    The length of the text.

Return Value

Type: array<Char[]
The array of characters starting at startIndex in the underlying ITextBuffer and extending to its end.

Exceptions

Exception Condition
ArgumentOutOfRangeException

startIndex is less than zero or greater than the length of the snapshot, or length is less than zero, or startIndex plus length is greater than the length of the snapshot.

.NET Framework Security

See Also

Reference

ITextSnapshot Interface

Microsoft.VisualStudio.Text Namespace