diff options
| author | Javier Solana <javiersolanahuertas@gmail.com> | 2024-07-06 15:32:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-06 09:32:01 -0400 |
| commit | bdf3a1eb92020a0d1ce202df14b49f2f13445476 (patch) | |
| tree | 98cb40a4a366863cab8e710949851bd4c2da1d5b /docs-src/content | |
| parent | 80b7c5a1aba49239b336d7eeed2525acc2d361be (diff) | |
feat(strings): New functions TrimRight and TrimLeft (#2148)
Signed-off-by: Javier Solana javier.solana@cabify.com
Signed-off-by: Javier Solana javier.solana@cabify.com
Co-authored-by: Javier Solana <javier.solana@cabify.com>
Diffstat (limited to 'docs-src/content')
| -rw-r--r-- | docs-src/content/functions/strings.yml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docs-src/content/functions/strings.yml b/docs-src/content/functions/strings.yml index 07378fb0..8c10a8f5 100644 --- a/docs-src/content/functions/strings.yml +++ b/docs-src/content/functions/strings.yml @@ -421,6 +421,23 @@ funcs: - | $ gomplate -i '{{ "_-foo-_" | strings.Trim "_-" }}' foo + - name: strings.TrimLeft + # released: v4.1.0 + description: | + Trims a string by removing the given characters from the beginning of the string. + This wraps Go's [`strings.TrimLeft`](https://pkg.go.dev/strings#TrimLeft). + pipeline: true + arguments: + - name: cutset + required: true + description: the set of characters to cut + - name: input + required: true + description: the input + examples: + - | + $ gomplate -i '{{ " - hello, world!" | strings.TrimLeft " " }}' + - hello, world! - name: strings.TrimPrefix released: v2.5.0 description: | @@ -439,6 +456,23 @@ funcs: - | $ gomplate -i '{{ "hello, world" | strings.TrimPrefix "hello, " }}' world + - name: strings.TrimRight + # released: v4.1.0 + description: | + Trims a string by removing the given characters from the end of the string. + This wraps Go's [`strings.TrimRight`](https://pkg.go.dev/strings#TrimRight). + pipeline: true + arguments: + - name: cutset + required: true + description: the set of characters to cut + - name: input + required: true + description: the input + examples: + - | + $ gomplate -i '{{ "hello, world! " | strings.TrimRight " " }}' + hello, world! - name: strings.TrimSpace alias: trimSpace released: v1.9.0 |
