Skip to content
Lists & Helpers arraySlice

$arraySlice — A part of an array; stores it in another array or returns JSON.

A part of an array; stores it in another array or returns JSON.

Syntax

$arraySlice[array;other;start;(end)]

Parameters

  • array (text, required) — Name of the array.
  • other (text, required, may be empty) — Array that receives the result.
  • start (number, required) — First index.
  • end (number, optional) — End index (excluded).

Return Value

  • string.

Usage

$arraySlice[a;;1] → ["1","2"]

Example

$arrayLoad[a;,;3,1,2]
$sendMessage[$arraySlice[a;;1]]

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.