Like in most programming languages nexl uses square brackets to resolve elements
subset from array ( or string ).
fruits = ['Mango', 'Banana', 'Mango', 'Annona', 'Grape'];
The following expression resolves a ["Mango","Annona"]
array subset (
counting from zero ):
To resolve a single array element use the following expression:
It resolves a "Annona"
You can also mix different ranges and single elements countless times between square
brackets ( spaces are ignored ).
The last expression resolves a ["Banana","Annona","Grape"]
characters can be used to access a first and last
The last expression resolves all array elements from the first to the last.
The next feature is negative indexes.
Negative indexes are being counted from the end.
I.e. the -1
index equals to the index number 3 if an array has 5
For example the following expression will resolve last two array elements ["Annona","Grape"]
nexl also allows to use expressions instead of hard coded numbers between
square brackets. It allows to slice arrays/strings dynamically.
variable must be of a number type or can has one of the following
two string values '^' or '$' to access first and last indexes.
variable can be provided as argument