in reply to Split a string with multiple trailing delimeters?
If you use the third split parameter it will do the trick. A value of 5 works for your example, but any value larger also works which is useful if you are not sure how many fields there are:
print "'$_'" for split '[*]{2}', $s, 100;; '123' 'abc' '' '' ''
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Split a string with multiple trailing delimeters?
by Fletch (Bishop) on Jan 04, 2011 at 18:47 UTC | |
|
Re^2: Split a string with multiple trailing delimeters?
by haolecoder (Initiate) on Jan 04, 2011 at 18:57 UTC |