docs: add documentation for starts and endswith

pull/31220/head
Joshua Barton 4 years ago
parent fd3798b276
commit 2278d30857

@ -319,6 +319,10 @@
"title": "<code>chomp</code>",
"href": "/language/functions/chomp"
},
{
"title": "<code>endswith</code>",
"href": "/language/functions/endswith"
},
{
"title": "<code>format</code>",
"href": "/language/functions/format"
@ -352,6 +356,10 @@
"title": "<code>split</code>",
"href": "/language/functions/split"
},
{
"title": "<code>startswith</code>",
"href": "/language/functions/startswith"
},
{
"title": "<code>strrev</code>",
"href": "/language/functions/strrev"
@ -776,6 +784,7 @@
{ "title": "dirname", "path": "functions/dirname", "hidden": true },
{ "title": "distinct", "path": "functions/distinct", "hidden": true },
{ "title": "element", "path": "functions/element", "hidden": true },
{ "title": "endswith", "path": "functions/endswith", "hidden": true },
{ "title": "file", "path": "functions/file", "hidden": true },
{ "title": "filebase64", "path": "functions/filebase64", "hidden": true },
{
@ -851,6 +860,7 @@
{ "title": "slice", "path": "functions/slice", "hidden": true },
{ "title": "sort", "path": "functions/sort", "hidden": true },
{ "title": "split", "path": "functions/split", "hidden": true },
{ "title": "startswith", "path": "functions/startswith", "hidden": true },
{ "title": "strrev", "path": "functions/strrev", "hidden": true },
{ "title": "substr", "path": "functions/substr", "hidden": true },
{ "title": "sum", "path": "functions/sum", "hidden": true },

@ -0,0 +1,30 @@
---
page_title: endswith - Functions - Configuration Language
description: |-
The endswith function takes a given string and a given suffix value,
and returns true if the first given string contains the given value at its end.
---
# `endswith` Function
`endswith` takes a given string and a given suffix value,
and returns true if the first given string contains the given value at its end.
```hcl
endswith(string, suffix)
```
## Examples
```
> endswith("hello world", "world")
true
> endswith("hello world", "hello")
false
```
## Related Functions
- [`startswith`](/language/functions/startswith) takes a given string and a given prefix value,
and returns true if the first given string contains the given value at its beginning

@ -0,0 +1,30 @@
---
page_title: startsswith - Functions - Configuration Language
description: |-
The startswith function takes a given string and a given prefix value,
and returns true if the first given string contains the given value at its beginning.
---
# `startswith` Function
`startswith` takes a given string and a given prefix value,
and returns true if the first given string contains the given value at its beginning.
```hcl
startswith(string, prefix)
```
## Examples
```
> startswith("hello world", "hello")
true
> startswith("hello world", "world")
false
```
## Related Functions
- [`endswith`](/language/functions/endswith) takes a given string and a given suffix value,
and returns true if the first given string contains the given value at its end

@ -370,6 +370,10 @@
<a href="/docs/language/functions/chomp.html">chomp</a>
</li>
<li>
<a href="/docs/language/functions/endswith.html">endswith</a>
</li>
<li>
<a href="/docs/language/functions/format.html">format</a>
</li>
@ -406,6 +410,10 @@
<a href="/docs/language/functions/split.html">split</a>
</li>
<li>
<a href="/docs/language/functions/startswith.html">startswith</a>
</li>
<li>
<a href="/docs/language/functions/strrev.html">strrev</a>
</li>

Loading…
Cancel
Save