Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add startswith and endswith funcs #31220

Merged
merged 5 commits into from Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions website/docs/language/functions/endswith.mdx
@@ -1,14 +1,12 @@
---
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.
The endswith function takes two values: a string to check and a suffix string. It returns true if the first string ends with that exact suffix value.
alisdair marked this conversation as resolved.
Show resolved Hide resolved
---

# `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.
`endswith` takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix value.
alisdair marked this conversation as resolved.
Show resolved Hide resolved

```hcl
endswith(string, suffix)
Expand All @@ -26,5 +24,4 @@ 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
- [`startswith`](/language/functions/startswith) takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix.
9 changes: 3 additions & 6 deletions website/docs/language/functions/startswith.mdx
@@ -1,14 +1,12 @@
---
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.
The startswith function takes two values: a string to check and a prefix string. It returns true if the string begins with that exact prefix.
---

# `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.
`startswith` takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix.

```hcl
startswith(string, prefix)
Expand All @@ -26,5 +24,4 @@ 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
- [`endswith`](/language/functions/endswith) takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix value.
alisdair marked this conversation as resolved.
Show resolved Hide resolved