github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/job-specification/hcl2/functions/collection/sort.mdx (about) 1 --- 2 layout: docs 3 page_title: sort - Functions - Configuration Language 4 description: |- 5 The sort function takes a list of strings and returns a new list with those 6 strings sorted lexicographically. 7 --- 8 9 # `sort` Function 10 11 `sort` takes a list of strings and returns a new list with those strings 12 sorted lexicographically. 13 14 The sort is in terms of Unicode codepoints, with higher codepoints appearing 15 after lower ones in the result. 16 17 ## Examples 18 19 ```shell-session 20 > sort(["e", "d", "a", "x"]) 21 [ 22 "a", 23 "d", 24 "e", 25 "x", 26 ] 27 ```