hugo/docs/content/en/functions/collections/In.md
Bjørn Erik Pedersen 5fd1e74903
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
```
git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash
```

Closes #11925
2024-01-27 10:48:57 +01:00

916 B

title description categories keywords action aliases
collections.In Reports whether the given value is a member of the given set.
aliases related returnType signatures
in
functions/strings/Contains
functions/strings/ContainsAny
functions/strings/ContainsNonSpace
functions/strings/HasPrefix
functions/strings/HasSuffix
bool
collections.In SET VALUE
/functions/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