delete a segment of a string - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Miscellaneous Utilities : StringTools/Delete

StringTools[Delete] - delete a segment of a string

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 .

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]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam