mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-14 19:20:04 -04:00
string functions
This commit is contained in:
parent
8b84cce611
commit
d8fa10e6eb
20 changed files with 52 additions and 61 deletions
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
page_title: chomp - Functions - Configuration Language
|
||||
description: The chomp function removes newline characters at the end of a string.
|
||||
page_title: chomp function reference
|
||||
description: The `chomp` function removes newline characters at the end of a string. Learn how to use the `chomp` function in Packer templates.
|
||||
---
|
||||
|
||||
# `chomp` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
---
|
||||
page_title: format - Functions - Configuration Language
|
||||
page_title: format function reference
|
||||
description: |-
|
||||
The format function produces a string by formatting a number of other values
|
||||
according to a specification string.
|
||||
The `format` function applies a specification to format values and produce a new string. Learn how to use the `format` function in Packer templates.
|
||||
---
|
||||
|
||||
# `format` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
---
|
||||
page_title: formatlist - Functions - Configuration Language
|
||||
page_title: formatlist function reference
|
||||
description: |-
|
||||
The formatlist function produces a list of strings by formatting a number of
|
||||
other values according to a specification string.
|
||||
The `formatlist` function applies a specification to format values and produce a list of strings. Learn how to use the `formatlist` function in Packer templates.
|
||||
---
|
||||
|
||||
# `formatlist` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: indent - Functions - Configuration Language
|
||||
page_title: indent function reference
|
||||
description: |-
|
||||
The indent function adds a number of spaces to the beginnings of all but the
|
||||
first line of a given multi-line string.
|
||||
The `indent` function adds spaces to the beginnings of all but the
|
||||
first line of a given multi-line string. Learn how to use the `indent` function in Packer templates.
|
||||
---
|
||||
|
||||
# `indent` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: join - Functions - Configuration Language
|
||||
page_title: join function reference
|
||||
description: |-
|
||||
The join function produces a string by concatenating the elements of a list
|
||||
with a given delimiter.
|
||||
The `join` function produces a string by concatenating the elements of a list
|
||||
with a given delimiter. Learn how to use the `join` function in Packer templates.
|
||||
---
|
||||
|
||||
# `join` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: lower - Functions - Configuration Language
|
||||
page_title: lower function reference
|
||||
description: >-
|
||||
The lower function converts all cased letters in the given string to
|
||||
lowercase.
|
||||
The `lower` function converts all uppercase letters in the given string to
|
||||
lowercase. Learn how to use the `lower` function in Packer templates.
|
||||
---
|
||||
|
||||
# `lower` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: regex - Functions - Configuration Language
|
||||
page_title: regex function reference
|
||||
description: |-
|
||||
The regex function applies a regular expression to a string and returns the
|
||||
matching substrings.
|
||||
The `regex` function applies a regular expression to a string and returns the
|
||||
matching substrings. Learn how to use the `regex` function in Packer templates.
|
||||
---
|
||||
|
||||
# `regex` Function
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
---
|
||||
page_title: regex_replace - Functions - Configuration Language
|
||||
page_title: regex_replace function reference
|
||||
description: >-
|
||||
The regex_replace function searches a given string for another given
|
||||
substring,
|
||||
|
||||
and replaces all occurrences with a given replacement string. The substring
|
||||
|
||||
argument can be a valid regular expression or a string.
|
||||
The `regex_replace` function matches and replaces all occurrences of a substring with a replacement string. Learn how to use the `regex_replace` function in Packer templates.
|
||||
---
|
||||
|
||||
# `regex_replace` Function
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
page_title: regexall - Functions - Configuration Language
|
||||
page_title: regexall function reference
|
||||
description: |-
|
||||
The regexall function applies a regular expression to a string and returns a list of all matches.
|
||||
The `regexall` function applies a regular expression to a string and returns a list of all matches. Learn how to use the `regexall` function in Packer templates.
|
||||
---
|
||||
|
||||
# `regexall` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
---
|
||||
page_title: replace - Functions - Configuration Language
|
||||
page_title: replace function reference
|
||||
description: |-
|
||||
The replace function searches a given string for another given substring,
|
||||
and replaces all occurrences with a given replacement string.
|
||||
The `replace` function replaces all occurrences of substring with a given string. Learn how to use the `replace` function in Packer templates.
|
||||
---
|
||||
|
||||
# `replace` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
---
|
||||
page_title: split - Functions - Configuration Language
|
||||
page_title: split function reference
|
||||
description: |-
|
||||
The split function produces a list by dividing a given string at all
|
||||
occurrences of a given separator.
|
||||
The `split` function divides the given string according to the specified separator to produce a list. Learn how to use the `split` function in Packer templates.
|
||||
---
|
||||
|
||||
# `split` Function
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
---
|
||||
page_title: strcontains - Functions - Configuration Language
|
||||
page_title: strcontains function reference
|
||||
description: |-
|
||||
The strcontains function checks whether a given string can be found within another string.
|
||||
The `strcontains` function searches for a substring within a string. Learn how to use the `strcontains` function in Packer templates.
|
||||
---
|
||||
|
||||
# `strcontains` Function
|
||||
|
||||
`strcontains` function checks whether a substring is within another string.
|
||||
The `strcontains` function searches for a substring within a string.
|
||||
|
||||
```hcl
|
||||
strcontains(string, substr)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
page_title: strrev - Functions - Configuration Language
|
||||
description: The strrev function reverses a string.
|
||||
page_title: strrev function reference
|
||||
description: The `strrev` function reverses a string. Learn how to use the `strrev` function in Packer templates.
|
||||
---
|
||||
|
||||
# `strrev` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: substr - Functions - Configuration Language
|
||||
page_title: substr function reference
|
||||
description: |-
|
||||
The substr function extracts a substring from a given string by offset and
|
||||
length.
|
||||
The `substr` function extracts a substring from a given string using an offset and
|
||||
length. Learn how to use the `substr` function in Packer templates.
|
||||
---
|
||||
|
||||
# `substr` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: title - Functions - Configuration Language
|
||||
page_title: title function reference
|
||||
description: |-
|
||||
The title function converts the first letter of each word in a given string
|
||||
to uppercase.
|
||||
The `title` function converts the first letter of each word in a given string
|
||||
to uppercase. Learn how to use the `title` function in Packer templates.
|
||||
---
|
||||
|
||||
# `title` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: trim - Functions - Configuration Language
|
||||
page_title: trim function reference
|
||||
description: |-
|
||||
The trim function removes the specified characters from the start and end of
|
||||
a given string.
|
||||
The `trim` function removes the specified characters from the start and end of
|
||||
a given string. Learn how to use the `trim` function in Packer templates.
|
||||
---
|
||||
|
||||
# `trim` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: trimprefix - Functions - Configuration Language
|
||||
page_title: trimprefix function reference
|
||||
description: |-
|
||||
The trimprefix function removes the specified prefix from the start of a
|
||||
given string.
|
||||
The `trimprefix` function removes the specified prefix from the start of a
|
||||
given string. Learn how to use the `trimprefix` function in Packer templates.
|
||||
---
|
||||
|
||||
# `trimprefix` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: trimspace - Functions - Configuration Language
|
||||
page_title: trimspace function reference
|
||||
description: |-
|
||||
The trimspace function removes space characters from the start and end of
|
||||
a given string.
|
||||
The `trimspace` function removes space characters from the start and end of
|
||||
a given string. Learn how to use the `trimpsace` function in Packer templates.
|
||||
---
|
||||
|
||||
# `trimspace` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: trimsuffix - Functions - Configuration Language
|
||||
page_title: trimsuffix function reference
|
||||
description: |-
|
||||
The trimsuffix function removes the specified suffix from the end of a
|
||||
given string.
|
||||
The `trimsuffix` function removes the specified suffix from the end of a
|
||||
given string. Learn how to use the `trimsuffix` function in Packer templates.
|
||||
---
|
||||
|
||||
# `trimsuffix` Function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
page_title: upper - Functions - Configuration Language
|
||||
page_title: upper function reference
|
||||
description: >-
|
||||
The upper function converts all cased letters in the given string to
|
||||
uppercase.
|
||||
The `upper` function converts all lowercase letters in the given string to
|
||||
uppercase. Learn how to use the `upper` function in Packer templates.
|
||||
---
|
||||
|
||||
# `upper` Function
|
||||
|
|
|
|||
Loading…
Reference in a new issue