Skip to content
Lists & Helpers listSort

$listSort — Sorts a list alphabetically (not case sensitive) or by number

Sorts a list alphabetically (not case sensitive) or by number.

Syntax

$listSort[list;(order);(numeric);(separator)]

Parameters

  • list (text, required) — The items.
  • order (asc or desc, optional) — Default: asc.
  • numeric (yes or no, optional) — yes compares numbers. Default: no. With yes, an item that is not a number raises an error.
  • separator (text, optional) — The text between two items. Default: ,. \n means a new line.

Return Value

  • string.

Usage

$listSort[b,C,a] → "a,b,C"
$listSort[10,9,100;desc;yes] → "100,10,9"

Example

$sendMessage[$listSort[b,C,a]]

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.