Skip to content

Commit e60d9eb

Browse files
committed
Minor changes and elimination of definitions
1 parent 23fb530 commit e60d9eb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

doc/Type/Str.pod6

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,14 @@ ASCII string: could not encode codepoint 222> will be issued.
195195
196196
=head2 routine index
197197
198-
multi sub index(Cool $s, Str:D $needle, Cool $startpos = 0 --> Int)
199-
multi method index(Cool $needle, Cool $startpos = 0 --> Int)
198+
multi method index(Str:D: Cool:D $needle --> Int:D)
199+
multi method index(Str:D: Str:D $needle --> Int:D)
200+
multi method index(Str:D: Cool:D $needle, Cool:D $pos --> Int:D)
201+
multi method index(Str:D: Str:D $needle, Int:D $pos --> Int:D)
200202
201-
Searches for C<$needle> in the string starting from C<$startpos>. It returns
202-
the offset into the string where C<$needle> was found, and C<Nil> if it was not
203-
found.
203+
Searches for C<$needle> in the string starting from C<$pos> (if present). It
204+
returns the offset into the string where C<$needle> was found, and C<Nil> if it
205+
was not found.
204206
205207
Examples:
206208
@@ -212,6 +214,9 @@ Examples:
212214
213215
say index("Camelia is a butterfly", "Onion").defined ?? 'OK' !! 'NOT'; # OUTPUT: «NOT␤»
214216
217+
Other forms of index, including a sub, are
218+
L<inherited from C<Cool>|/type/Cool#routine_index>. Check them there.
219+
215220
=head2 routine rindex
216221
217222
multi sub rindex(Str:D $haystack, Str:D $needle, Int $startpos = $haystack.chars --> Int)

0 commit comments

Comments
 (0)