in reply to Re: split a string at a defined index
in thread split a string at a defined index
... and split on a specific index (without using substr):
>perl -wMstrict -le "my $s = 'www,google,yahoo,345'; my ($v1, $v2) = split m{ (?<= \A .{16}) , }xms, $s; print qq{[$v1] [$v2]}; " [www,google,yahoo] [345]
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: split a string at a defined index
by BrowserUk (Patriarch) on Mar 29, 2010 at 08:19 UTC |