Difference between revisions of "Array.chunks()"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "* << Z3 Home * Z3 Language Documentation * Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member F...")
 
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
  
  
==Array.chunks(ChunkSize) ==
+
==Array.chunks(ChunkSize, SomeFunction) ==
  
Split the array into chunks of size ChunkSize.
+
Split the array into chunks of size ChunkSize. Apply SomeFunction to chunks, if provided.
  
 
1..25.chunks(3)
 
1..25.chunks(3)
Line 29: Line 29:
 
| 25  
 
| 25  
 
|}
 
|}
 +
 +
 +
== See Also ==
 +
[[Array.pieces()| pieces]]
 +
 +
[[Array.parts()| parts]]

Latest revision as of 20:53, 21 March 2024


Array.chunks(ChunkSize, SomeFunction)

Split the array into chunks of size ChunkSize. Apply SomeFunction to chunks, if provided.

1..25.chunks(3)

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25


See Also

pieces

parts