Setunion()

From TinyMUX
Jump to navigation Jump to search


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

This function returns the union of two sets -- i.e., all the elements of both <list1> and <list2>, minus any duplicate elements. Think of it as CAT() without duplicated words. The list 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, setunion() sorts using case-sensitive alphanumeric. If '?' or left blank, setunion() will try to determine the type of sort to perform automatically.

Example

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

You say, "bar baz foo gleep moof"

> say setunion(foo|bar|foo,,|,.)

You say, "bar.foo"

Related Topics

setdiff(), setinter(), sort()