mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
30 lines
604 B
Markdown
30 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
|
||
|
```
|