diff --git a/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx b/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx new file mode 100644 index 000000000..ea3389c37 --- /dev/null +++ b/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx @@ -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 +``` diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index 0a7242a98..24c55feb6 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -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"