@@ -549,15 +549,16 @@ multi method split(Str:D: List:D $delimiters, $limit = Inf,
549
549
550
550
Splits a string up into pieces based on delimiters found in the string.
551
551
552
- If C<DELIMITER> is a string, it is searched for literally and not treated
553
- as a regex. If C<DELIMITER> is the empty string, it effectively returns all
554
- characters of the string separately (plus an empty string at the begin and at
555
- the end). If C<PATTERN> is a regular expression, then that will be used
556
- to split up the string. If C<DELIMITERS> is a list, then all of its elements
557
- will be considered a delimiter (either a string or a regular expression) to
558
- split the string on.
559
-
560
- The optional C<LIMIT> indicates in how many segments the string should be
552
+ If C<$delimiter> is a string, it is used literally. An empty string
553
+ effectively returns all characters of the string separately (plus an
554
+ empty string at the begin and at the end).
555
+
556
+ C<$delimiter> also can be passed as a L<C<Regex>|/type/Regex>.
557
+
558
+ If a list is used, then each of its elements
559
+ will be considered a delimiter based on its type as mentioned above.
560
+
561
+ The optional C<$limit> indicates in how many segments the string should be
561
562
split, if possible. It defaults to B<Inf> (or B<*>, whichever way you look at
562
563
it), which means "as many as possible". Note that specifying negative limits
563
564
will not produce any meaningful results.
0 commit comments