subStr Function

Retrieves part of a string.


str subStr(str _text, int _position, int _number)

Parameter

Description

_text

The original string.

_position

The position in _text to begin the new string.

_number

The number of characters to select from _position onwards.

If there is a minus sign preceding _number, the system selects the substring backward from the specified position.

A new string composed of _number characters from _text, beginning at the character represented by _position.

// Returns the text string CDEFG.
subStr("ABCDEFGHIJ",3,5);
 
// Returns the text string DEFG.
subStr("ABCDEFGHIJ",7,-4);

Community Additions

ADD
Show: