A function like SplitBy, but with added support for using the indices of the elements in the list
Contributed by:
Sjoerd Smit
Examples
Basic Examples (3)
Split the list into runs of length up to 3:
Single out the elements at positions that are a multiple of 4:
Split based on both the value and position in the list:
This might clarify:
Scope (1)
Specify a second splitting function to partition the sublists into runs of length up to 2:
Properties and Relations (3)
SplitByIndexed can be used in the same way as SplitBy if you restrict the function to only the first argument:
However, SplitByIndexed will evaluate the test function only exactly once for each element:
SplitBy evaluates the test function twice for all elements except the first and last:
Publisher
Sjoerd Smit
Version History
-
1.0.1
– 23 August 2023
-
1.0.0
– 21 August 2023
Related Resources