REBOL Document

Exclude - Function Summary


Summary:

Return the first set less the second set.

Usage:

exclude set1 set2

Arguments:

set1 - First data set (must be: series bitset)

set2 - Second data set (must be: series bitset)

Refinements:

/case - Uses case-sensitive comparison.

/skip - Treat the series as records of fixed size

size - The size argument. (must be: integer)

Description:

Returns the elements of the first set less the elements of the second set. In other words, it removes from the first set all elements that are part of the second set.


    lunch: [ham cheese bread carrot]
    dinner: [ham salad carrot rice]
    probe exclude lunch dinner
    [cheese bread]


    probe exclude [1 3 2 4] [3 5 4 6]
    [1 2]


    string1: "CBAD"    ; A B C D scrambled
    string2: "EDCF"    ; C D E F scrambled
    probe exclude string1 string2
    "BA"


    items: [1 1 2 3 2 4 5 1 2]
    probe exclude items items  ; get unique set
    []


    str: "abcacbaabcca"
    probe exclude str str
    ""

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

Related:

difference - Return the difference of two data sets.
intersect - Create a new value that is the intersection of the two arguments.
union - Creates a new set that is the union of the two arguments.


<Back | Index | Next>

Copyright 2004 REBOL Technologies