Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Multisplit/Raku/multisplit.raku
Normal file
11
Task/Multisplit/Raku/multisplit.raku
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
sub multisplit($str, @seps) { $str.split: / ||@seps /, :v }
|
||||
|
||||
my @chunks = multisplit 'a!===b=!=c==d', < == != = >;
|
||||
|
||||
# Print the strings.
|
||||
say @chunks».Str.raku;
|
||||
|
||||
# Print the positions of the separators.
|
||||
for grep Match, @chunks -> $s {
|
||||
say "{$s.fmt: '%2s'} from {$s.from.fmt: '%2d'} to {$s.to.fmt: '%2d'}";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue