Share via


TextBuffer.subStr(Int32, Int32) Method

Definition

Retrieves part of the content of the TextBuffer object (a substring).

public:
 virtual System::String ^ subStr(int _start, int _length);
public virtual string subStr (int _start, int _length);
abstract member subStr : int * int -> string
override this.subStr : int * int -> string
Public Overridable Function subStr (_start As Integer, _length As Integer) As String

Parameters

_start
Int32

The length of the desired substring.

_length
Int32

The length of the desired substring.

Returns

A string that contains the specified part of the TextBuffer object content.

Remarks

When you specify the start position for substring, use 1 for the first character in the content, 2 for the second character, and so on.

The following example demonstrates the subStr method.

{ 
    TextBuffer txtb = new TextBuffer(); 
    str mystr; 
    if (txtb.fromClipboard()) 
    { 
        mystr = txtb.subStr(10,15);  
        // 15 long substring starting at position 10. 
    } 
}

Applies to