diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2022-12-29 09:45:38 -0500 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2022-12-29 09:45:38 -0500 |
| commit | fde6cbeb6868f38d1bb02454a5f6413c91935f5b (patch) | |
| tree | 49891d1400fbbb05804c662bd1e4a480f4a59ce0 /docs-src/content | |
| parent | db2957873903b397188d96dd4119f1ed9c2a0ea9 (diff) | |
Add strings.SkipLines function
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs-src/content')
| -rw-r--r-- | docs-src/content/functions/strings.yml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs-src/content/functions/strings.yml b/docs-src/content/functions/strings.yml index e4796bd3..709288b6 100644 --- a/docs-src/content/functions/strings.yml +++ b/docs-src/content/functions/strings.yml @@ -137,6 +137,29 @@ funcs: - | $ gomplate -i '{{ (coll.Slice "foo" "bar" "baz") | strings.Sort }}' [bar baz foo] + - name: strings.SkipLines + description: | + Skips the given number of lines (each ending in a `\n`), returning the + remainder. + + If `skip` is greater than the number of lines in `in`, an empty string is + returned. + pipeline: true + arguments: + - name: skip + required: true + description: the number of lines to skip - must be a positive number + - name: in + required: true + description: the input string + examples: + - | + $ gomplate -i '{{ "foo\nbar\nbaz" | strings.SkipLines 2 }}' + baz + - | + $ gomplate -i '{{ strings.SkipLines 1 "foo\nbar\nbaz" }}' + bar + baz - name: strings.Split description: | _Not to be confused with [`split`](#split), which is deprecated._ |
