type
returns
Method
array<string>
name
description
size
int
Size of each chunk in resulting array
Splits the given string into substrings of the given size.
"1234".chunk(2) == ["12", "34"] "Hello".chunk(3) == ["Hel", "lo"]
Last updated 5 years ago
Was this helpful?