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

REBOL 3 Functions: unique

unique  set1  /case  /skip  size

Returns the data set with duplicates removed.

Arguments:

set1 [block! string! binary! bitset! typeset!]

Refinements:

/case - Use case-sensitive comparison (except bitsets)

/skip - Treat the series as records of fixed size

size [integer!]

See also:

intersect   union   difference   exclude  

Description

Removes all duplicate values from a set or series:

lunch: [ham cheese bread carrot ham ham carrot]
probe unique lunch
[ham cheese bread carrot]
probe unique [1 3 2 4 3 5 4 6]
[1 3 2 4 5 6]
string: "CBADEDCF"
probe unique string
"CBADEF"

Note that performing this function over very large data sets can be CPU intensive.


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