File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,22 @@ according to named parameter C<:end>.
444
444
# then the $first-prime supply reaches its end
445
445
$first-prime.tap: &say;
446
446
447
+ = head2 method split
448
+
449
+ multi method split(Supply:D: \delimiter)
450
+ multi method split(Supply:D: \delimiter, \limit)
451
+
452
+ This method creates a supply of the values returned by the C < Str.split >
453
+ method called on the string collected from the invocant.
454
+ See L « C < Str.split > |/type/Str#routine_split» for details on the
455
+ C < \delimiter > argument as well as available extra named parameters.
456
+ The created supply can be limited with the C < \limit > argument, see
457
+ L « C < .head > |#method head» .
458
+
459
+ my $words = Supply.from-list(<Hello World From Raku!>);
460
+ my $s = $words.split(/ <?upper> /, 2, :skip-empty);
461
+ $s.tap(&say); # OUTPUT: «HelloWorld»
462
+
447
463
= head2 method rotor
448
464
449
465
method rotor(Supply:D: @cycle --> Supply:D)
You can’t perform that action at this time.
0 commit comments