Hi guys,
I am facing a trouble that I have a list of numbers:
List of Number (Integer) - 6 items
I need to split them to three array, and each array has 2 number values.
so it still going to be a list, which has 3 array, and each array has 2 values.
Can anyone can help me for this?
Discussion posts and replies are publicly visible
This code snippet is an example for splitting an array into sub-arrays (for now, embedded in a dictionary) where you can set the desired "chunk" size (the length of the resulting sub-lists) by changing the value of local!neListChunkSize.
a!localVariables( local!list: {11, 22, 33, 44, 55, 66}, local!newListChunkSize: 2, local!newListLength: tointeger(ceiling(length(local!list) / local!newListChunkSize)), a!forEach( enumerate(local!newListLength), { chunk: fv!item, subList: { local!list[fv!index + fv!item], local!list[fv!index + fv!item + 1] } } ) )