summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2022-12-29 09:45:38 -0500
committerDave Henderson <dhenderson@gmail.com>2022-12-29 09:45:38 -0500
commitfde6cbeb6868f38d1bb02454a5f6413c91935f5b (patch)
tree49891d1400fbbb05804c662bd1e4a480f4a59ce0 /docs
parentdb2957873903b397188d96dd4119f1ed9c2a0ea9 (diff)
Add strings.SkipLines function
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/content/functions/strings.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/docs/content/functions/strings.md b/docs/content/functions/strings.md
index 57d3965f..37859d5a 100644
--- a/docs/content/functions/strings.md
+++ b/docs/content/functions/strings.md
@@ -207,6 +207,42 @@ $ gomplate -i '{{ (coll.Slice "foo" "bar" "baz") | strings.Sort }}'
[bar baz foo]
```
+## `strings.SkipLines`
+
+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.
+
+### Usage
+
+```go
+strings.SkipLines skip in
+```
+```go
+in | strings.SkipLines skip
+```
+
+### Arguments
+
+| name | description |
+|------|-------------|
+| `skip` | _(required)_ the number of lines to skip - must be a positive number |
+| `in` | _(required)_ the input string |
+
+### Examples
+
+```console
+$ gomplate -i '{{ "foo\nbar\nbaz" | strings.SkipLines 2 }}'
+baz
+```
+```console
+$ gomplate -i '{{ strings.SkipLines 1 "foo\nbar\nbaz" }}'
+bar
+baz
+```
+
## `strings.Split`
_Not to be confused with [`split`](#split), which is deprecated._