Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Multisplit/Perl/multisplit.pl
Normal file
11
Task/Multisplit/Perl/multisplit.pl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
sub multisplit {
|
||||
my ($sep, $string, %opt) = @_ ;
|
||||
$sep = join '|', map quotemeta($_), @$sep;
|
||||
$sep = "($sep)" if $opt{keep_separators};
|
||||
split /$sep/, $string, -1;
|
||||
}
|
||||
|
||||
print "'$_' " for multisplit ['==','!=','='], "a!===b=!=c";
|
||||
print "\n";
|
||||
print "'$_' " for multisplit ['==','!=','='], "a!===b=!=c", keep_separators => 1;
|
||||
print "\n";
|
||||
Loading…
Add table
Add a link
Reference in a new issue