Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add documentation for starts and endswith
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters