Spec-Zone.ru › OpenTofu 1.11

setsubtract Function

The 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.

Code Block
setsubtract(a, b)

Examples​

Code Block
> setsubtract(["a", "b", "c"], ["a", "c"])
toset([
  "b",
])

Set Difference (Symmetric Difference)​

Code Block
> setunion(setsubtract(["a", "b", "c"], ["a", "c", "d"]), setsubtract(["a", "c", "d"], ["a", "b", "c"]))
toset([
  "b",
  "d",
])

Related Functions​

  • setintersection computes the intersection of multiple sets
  • setproduct computes the Cartesian product of multiple sets.
  • setunion computes the union of multiple sets.

Copyright (c) The OpenTofu Authors
Copyright (c) 2014 HashiCorp, Inc.
Mozilla Public License, version 2.0
https://opentofu.org/docs/v1.11/language/functions/setsubtract/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API