mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
docs: add strcontains function doc
This commit is contained in:
parent
0ddcbaf18f
commit
35682265c4
2 changed files with 29 additions and 0 deletions
25
website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx
vendored
Normal file
25
website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
page_title: strcontains - Functions - Configuration Language
|
||||
description: |-
|
||||
The strcontains function checks whether a given string can be found within another string.
|
||||
---
|
||||
|
||||
# `strcontains` Function
|
||||
|
||||
`strcontains` function checks whether a substring is within another string.
|
||||
|
||||
```hcl
|
||||
strcontains(string, substr)
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
```
|
||||
> strcontains("hello world", "wor")
|
||||
true
|
||||
```
|
||||
|
||||
```
|
||||
> strcontains("hello world", "wod")
|
||||
false
|
||||
```
|
||||
|
|
@ -285,6 +285,10 @@
|
|||
"title": "split",
|
||||
"path": "templates/hcl_templates/functions/string/split"
|
||||
},
|
||||
{
|
||||
"title": "strcontains",
|
||||
"path": "templates/hcl_templates/functions/string/strcontains"
|
||||
},
|
||||
{
|
||||
"title": "strrev",
|
||||
"path": "templates/hcl_templates/functions/string/strrev"
|
||||
|
|
|
|||
Loading…
Reference in a new issue