Leser: 1
|< 1 2 >| | 11 Einträge, 2 Seiten |
1
2
3
4
5
6
$string = "a=b c=d";
@array = split /(=)|\s/, $string;
foreach (@array)
{
$_ =~ s/\s(.*)/$1/;
}
1 2 3 4 5 6 7
$string = "a=b c=d"; @array = split /(=)|\s/, $string; for ($i = 0; $i <= $#array; $i++) { splice(@array,$i,1) unless defined $array[$i]; }
1
2
3
my $string = "a=b c=d";
my @array = split /(=)|\s/, $string;
@array = grep{defined $_}@array;
1
2
3
4
my @array = split /\s/, $string;
for my $i (reverse 0 .. $#array) {
$array[$i] = splice @array, $i, 1, split(/(=)/, $array[$i]);
}
|< 1 2 >| | 11 Einträge, 2 Seiten |