2018-05-12 18:39:29 +02:00
|
|
|
---
|
2021-11-23 00:47:36 +01:00
|
|
|
page_title: sort - Functions - Configuration Language
|
2018-05-12 18:39:29 +02:00
|
|
|
description: |-
|
|
|
|
The sort function takes a list of strings and returns a new list with those
|
|
|
|
strings sorted lexicographically.
|
2021-11-23 00:47:36 +01:00
|
|
|
sidebar_title: sort
|
2018-05-12 18:39:29 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# `sort` Function
|
|
|
|
|
|
|
|
`sort` takes a list of strings and returns a new list with those strings
|
|
|
|
sorted lexicographically.
|
|
|
|
|
|
|
|
The sort is in terms of Unicode codepoints, with higher codepoints appearing
|
|
|
|
after lower ones in the result.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
```
|
|
|
|
> sort(["e", "d", "a", "x"])
|
|
|
|
[
|
|
|
|
"a",
|
|
|
|
"d",
|
|
|
|
"e",
|
|
|
|
"x",
|
|
|
|
]
|
|
|
|
```
|