Previous Up Next

6.3.9  Inserting an element into a list or a string

The insert command inserts elements into a list or string.

Examples

insert([3,4,2],2,5)
     

3,4,5,2
          
insert("342",2,"5")
     
“3452”           

insert returns an error if the index is too large.

insert([3,4,2],4,5)
     
 insert([3,4,2],4,5)         
 Error: Invalid dimension          

Previous Up Next