in reply to ignoring empty returns from split
I think this can be done by choosing the split-regexp carefully:
$line="one===two==three===four"; ($one,$two,$three,$four)=split (/=+/,$line); print "$one\n$two\n$three\n$four";
The + in the expression effectively tells split to treat multiple delimiters as one.
Hope that helps
Brother Ade
Update
Bug killed: $a!=$line, thanks sachmet...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: ignoring empty returns from split
by sachmet (Scribe) on Apr 24, 2001 at 04:11 UTC |