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)


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


/part - Removes to a given length or position

length [number! series! pair! char!]

See also:

append   change   clear   insert   sort  


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

An example using a block!:

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

  TOC < Back Next > - WIP Wiki Feedback Admin