TextBuffer.subStr Method [AX 2012]

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

public str subStr(int start, int length)

Run On

Called

Parameters

start
Type: int
The start position of the desired substring.
length
Type: int
The length of the desired substring.

Return Value

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

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.

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

Community Additions

ADD
Show: