Debian Codegraph @

docs/content/en/functions/collections/In.md

raw
1 ---
2 title: collections.In
3 description: Reports whether a value exists within the given slice or string.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 aliases: [in]
9 returnType: bool
10 signatures: [collections.In SLICE|STRING VALUE]
11 aliases: [/functions/in]
12 ---
13
14 ```go-html-template
15 {{ $s := slice "a" "b" "c" }}
16 {{ in $s "b" }} → true
17 ```
18
19 ```go-html-template
20 {{ $s := "abc" }}
21 {{ in $s "b" }} → true
22 ```