aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/functions/strings/Contains.md
blob: 0344b298182fcb55b5a4bbc6154ad6e150eedd59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
title: strings.Contains
description: Reports whether the given string contains the given substring.
categories: []
keywords: []
action:
  aliases: []
  related:
    - functions/strings/ContainsAny
    - functions/strings/ContainsNonSpace
    - functions/strings/HasPrefix
    - functions/strings/HasSuffix
    - functions/collections/In
  returnType: bool
  signatures: [strings.Contains STRING SUBSTRING]
aliases: [/functions/strings.contains]
---

```go-html-template
{{ strings.Contains "Hugo" "go" }} → true
```

The check is case sensitive:

```go-html-template
{{ strings.Contains "Hugo" "Go" }} → false
```