Setdiff()

From TinyMUX
Jump to navigation Jump to search


{{Function|setdiff(<list1>, <list2>[[[, <delim>], <output delim>], <sort type>])}}

This function returns the difference of two sets -- i.e., the elements in <list1> that aren't in <list2>. The list that is returned is sorted.

If <delim> is specified, it (rather than a space) is used to separate items in the list.

<sort type> may be used to specify the type of sort to perform (use 'd' for dbref, 'n' for integer numeric, 'f' for floating numeric, 'a' for case-sensitive alphanumeric, 'i' for case-insensitive alphanumeric, and '?' for automatic typing). If omitted, setdiff() sorts using case-sensitive alphanumeric. If '?' or left blank, setdiff() will try to determine the type of sort to perform automatically.

Example

> say setdiff(foo baz gleep bar, bar moof gleep)

You say, "baz foo"

Related Topics

setinter(), setunion(), sort()