P
Papago
Is there a single Perl command that will split a string into an array by
number of characters? For example, if I had the string:
$string = "monkey";
I could specify a lenght, such as 2, and it would put every pair of 2
characters into an array that looks something like this:
$array[0] = "mo";
$array[1] = "nk";
$array[3] = "ey";
Is that possible?
number of characters? For example, if I had the string:
$string = "monkey";
I could specify a lenght, such as 2, and it would put every pair of 2
characters into an array that looks something like this:
$array[0] = "mo";
$array[1] = "nk";
$array[3] = "ey";
Is that possible?