diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2018-07-18 21:35:33 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2018-07-18 21:35:33 -0400 |
| commit | c56dc624778fc3f9695a712c02c8b306da0c88b2 (patch) | |
| tree | ad4c9ac281511680014a465654ace05f3759ba78 /docs/content/functions/strings.md | |
| parent | 458c19fba9b7183bf60504af6005c7fc82fc3815 (diff) | |
Adding new strings.Sort function
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs/content/functions/strings.md')
| -rw-r--r-- | docs/content/functions/strings.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/content/functions/strings.md b/docs/content/functions/strings.md index 85442d42..e56fd68f 100644 --- a/docs/content/functions/strings.md +++ b/docs/content/functions/strings.md @@ -153,6 +153,35 @@ foo: quuz: 42 ``` +## `strings.Sort` + +**Alias:** `sort` + +Returns an alphanumerically-sorted copy of a given string list. + + +### Usage +```go +strings.Sort list +``` + +```go +list | strings.Sort +``` + +### Arguments + +| name | description | +|------|-------------| +| `list` | _(required)_ The list to sort | + +### Examples + +```console +$ gomplate -i '{{ (slice "foo" "bar" "baz") | sort }}' +[bar baz foo] +``` + ## `strings.Split` Creates a slice by splitting a string on a given delimiter. |
