From c56dc624778fc3f9695a712c02c8b306da0c88b2 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Wed, 18 Jul 2018 21:35:33 -0400 Subject: Adding new strings.Sort function Signed-off-by: Dave Henderson --- docs/content/functions/strings.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'docs/content/functions/strings.md') 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. -- cgit v1.2.3