hugo/docs/content/en/functions/strings/Contains.md
2023-10-20 09:43:56 +02:00

29 lines
604 B
Markdown

---
title: strings.Contains
description: Reports whether the string contains a substring.
categories: [functions]
keywords: []
menu:
docs:
parent: functions
function:
aliases: []
returnType: bool
signatures: [strings.Contains STRING SUBSTRING]
relatedFunctions:
- strings.Contains
- strings.ContainsAny
- strings.ContainsNonSpace
- strings.HasPrefix
- strings.HasSuffix
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
```