REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: remove

remove  series  /part  length

Removes value(s) from a series and returns after the remove. (Modifies)

Arguments:

series [series! gob! port! bitset! none!]

Refinements:

/part - Removes to a given length or position

length [number! series! pair! char!]

See also:

append   change   clear   insert   sort  

Description

Removes a single value from the current position in any type of series.

str: copy "send it here"
remove str
print str
end it here

Combine it with other functions to remove a value at a specific index:

remove find str "it"
print str
end t here

You can remove any number of values with the /PART refinement:

str: copy "send it here"
remove/part str 3
print str
d it here

The PART refinement also accepts an index of the series being removed form. It must be the same series.

remove/part str find str "here"
print str
here

An example using a block!:

blk: copy [red green blue]
remove next blk
probe blk
[red blue]


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin