subList

Returns a list composed of the elements between two positions in a list. The first index position is included in the returned list, while the second is excluded from the results.

Note: If you encounter erroneous behavior while using this method, ensure that you are using an upper-case L; i.e., subList, not sublist.

Syntax:

$[ScriptVariable]::subList(int fromIndex, int toIndex)

Parameters:

Example:

The following example illustrates the syntax for the sublist list method:

$alphabet = "A"

$alphabet::add("B")

$alphabet::add("C")

$alphabet::add("D")

$alphabet::add("E")

$alphabet::add("F")

$alphabet::add("G")

$alphabet::add("H")

$subAlpha = $alphabet::subList(2,5)

print($subAlpha)

Output:

CDE