Examples
Basic Examples (3)
Split before indices 2 and 5 so that sub-lists after the initial one start at these indices:
Split after instead of before, so that the sub-lists now end on these indices:
Explicitly specify to split before each index:
Scope (5)
If the list of indices is empty, the original list will be returned with an extra list around it:
Splitting the empty list always fails if the index list is not empty:
Splitting before 1 has no effect on the initial sublist:
Similarly, splitting after the last element does nothing:
Splitting at non-existing indices returns $Failed. Negative indices are not supported:
Properties and Relations (1)
SplitAtPositions[expr,{n},After] is equivalent to TakeDrop[expr,n]:
Version History
-
2.0.0
– 03 May 2022
-
1.0.0
– 18 April 2022
Related Resources