collections.In
Reports whether the given value is a member of the given set.
Syntax
collections.In SET VALUE
Returns
bool
Alias
in
The SET
can be an
array,
slice, or
string.
{{ $s := slice "a" "b" "c" }}
{{ in $s "b" }} → true
{{ $s := slice 1 2 3 }}
{{ in $s 2 }} → true
{{ $s := slice 1.11 2.22 3.33 }}
{{ in $s 2.22 }} → true
{{ $s := "abc" }}
{{ in $s "b" }} → true
Last updated:
January 19, 2025
:
Replace links to glossary terms with custom render hook syntax (69d7a781b)
Improve this page