StringTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

StringTools

  

Insert

  

insert a string into another

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Insert( s, position, t )

Parameters

s

-

string; Maple string

t

-

string; Maple string

position

-

non-negative integer; position in s at which to insert t

Description

• 

The Insert(s, position, t) command inserts a string t into the string s at position. The value of position must be an integer in the range 0..lengths. Position 0 is the position before the first character of s; position 1 is the position after the first character of s; position 2 is the position after the second character of s; and so on. Thus, Insert( s, 0, t ) is equivalent to catt,s, while Insert( s, length( s ), t ) is equivalent to cats,t.

Examples

withStringTools:

Insertabcd,0,=

=abcd

(1)

Insertabcd,1,=

a=bcd

(2)

Insertabcd,2,=

ab=cd

(3)

Insertabcd,3,=

abc=d

(4)

Insertabcd,4,=

abcd=

(5)

Insertabcd,5,=

Error, (in StringTools:-Insert) string index `5' out of range

Insert,0,Foo

Foo

(6)

seqInsertabc,n,,n=0..lengthabc

abc

(7)

See Also

string

StringTools

 


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