Skip to content

tm_setsubtract Function

The tm_setsubtract function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the relative complement of the second set.

hcl
tm_setsubtract(a, b)

Examples

sh
tm_setsubtract(["a", "b", "c"], ["a", "c"])
toset([
  "b",
])

Set Difference (Symmetric Difference)

sh
tm_setunion(tm_setsubtract(["a", "b", "c"], ["a", "c", "d"]), tm_setsubtract(["a", "c", "d"], ["a", "b", "c"]))
toset([
  "b",
  "d",
])