Delete - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


StringTools

  

Delete

  

delete a segment of a string

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Delete( s, rng )

Parameters

s

-

string; a Maple string

rng

-

range of characters to delete

Description

• 

The Delete(s,rng) command removes a segment of a string s, specified by the second argument rng.

• 

The range argument rng must specify a valid range of characters in the string s, unless the string s is empty. If s is the empty string, then the empty string is returned in all cases, no matter how the range is specified.

• 

When the endpoints of rng are equal, a single character of the non-empty string s is removed.

• 

Note that Delete( s, 1 .. length( s ) ) (or, equivalently, Delete( s, 1 .. -1 )) returns the empty string .

• 

All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters.  Thus, there is no support for multibyte character encodings, such as unicode encodings.

Examples

withStringTools:

Deleteabcde,2..3

ade

(1)

Deleteabcde,4..4

abce

(2)

Deleteabcde,2..2

ae

(3)

Deleteabcde,2..7

a

(4)

Delete,1..1

(5)

Delete,98..43

(6)

Delete,5..5

(7)

See Also

string

StringTools

StringTools[Insert]