strDel Function

Deletes a specified part of a text string.


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

Parameter

Description

_text

The text string to delete characters from.

_position

The position at which to start deleting characters.

_number

The number of characters to delete (including the character at position).

A minus in front of _number indicates that the (_number-1) characters before the character at _position are to be removed along with the character at _position.

The remaining characters in the text string.

strdel is complementary to substr.

// Returns the text string AEFGH.
strDel("ABCDEFGH",2,3);
 
// Returns the text string ABCGH.
strDel("ABCDEFGH",4,3);

Community Additions

ADD
Show: