From 35682265c4f891220109778e38ff5e1dc8aa8e97 Mon Sep 17 00:00:00 2001 From: Martin Grogan Date: Wed, 4 Dec 2024 11:13:07 -0500 Subject: [PATCH] docs: add strcontains function doc --- .../functions/string/strcontains.mdx | 25 +++++++++++++++++++ website/data/docs-nav-data.json | 4 +++ 2 files changed, 29 insertions(+) create mode 100644 website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx 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"