Convert string into an array by specifed maximum length of each chunk.

string:split(STRING $string, INT $split_length=1) : ARRAY

string:split('Hello World')
#=> [
#=>     "H",
#=>     "e",
#=>     "l",
#=>     "l",
#=>     "o",
#=>     " ",
#=>     "W",
#=>     "o",
#=>     "r",
#=>     "l",
#=>     "d"
#=> ]

string:split('Hello World', 3)
#=> [
#=>     "Hel",
#=>     "lo ",
#=>     "Wor",
#=>     "ld"
#=> ]

Copyright ©2013-2022 SunSed®. All rights reserved.