Skip to content

Commit 56f6381

Browse files
committed
Document Str.substr(Range)
1 parent d59d2b3 commit 56f6381

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Type/Str.pod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,13 @@ object representing the successful match, or C<Any> otherwise.
440440
=head2 routine substr
441441
442442
multi sub substr(Str:D $s, Int:D $from, Int:D $chars = $s.chars - $from) returns Str:D
443+
multi sub substr(Str:D $s, Range $from-to) returns Str:D
443444
multi method substr(Str:D $s: Int:D $from, Int:D $chars = $s.chars - $from) returns Str:D
445+
multi method substr(Str:D $s: Range $from-to) returns Str:D
444446
445447
Returns a part of the string, starting from the character with index C<$from>
446-
(where the first character has index 0) and with length C<$chars>.
448+
(where the first character has index 0) and with length C<$chars>. If a range is
449+
specified, its first and last indices are used to determine the size of the substring.
447450
448451
Examples:
449452

0 commit comments

Comments
 (0)