Hi, I have the following code. With my basic understanding of split, i thought that the o/p would be an array with 4 elements as : (,allon,native,).
But the result array after split contains only 3 elements. Why does it not have the 4th(empty) element.
my $str = ";allon;native;;"; my @arr = split /;/, $str; my $indx = 0; foreach (@arr){ print "$indx:$_\n"; $indx++; }
In reply to Question regarding split by rjohn1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |