Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Minor changes and elimination of definitions
  • Loading branch information
JJ committed Jan 12, 2019
1 parent 23fb530 commit e60d9eb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions doc/Type/Str.pod6
Expand Up @@ -195,12 +195,14 @@ ASCII string: could not encode codepoint 222> will be issued.
=head2 routine index
multi sub index(Cool $s, Str:D $needle, Cool $startpos = 0 --> Int)
multi method index(Cool $needle, Cool $startpos = 0 --> Int)
multi method index(Str:D: Cool:D $needle --> Int:D)
multi method index(Str:D: Str:D $needle --> Int:D)
multi method index(Str:D: Cool:D $needle, Cool:D $pos --> Int:D)
multi method index(Str:D: Str:D $needle, Int:D $pos --> Int:D)
Searches for C<$needle> in the string starting from C<$startpos>. It returns
the offset into the string where C<$needle> was found, and C<Nil> if it was not
found.
Searches for C<$needle> in the string starting from C<$pos> (if present). It
returns the offset into the string where C<$needle> was found, and C<Nil> if it
was not found.
Examples:
Expand All @@ -212,6 +214,9 @@ Examples:
say index("Camelia is a butterfly", "Onion").defined ?? 'OK' !! 'NOT'; # OUTPUT: «NOT␤»
Other forms of index, including a sub, are
L<inherited from C<Cool>|/type/Cool#routine_index>. Check them there.
=head2 routine rindex
multi sub rindex(Str:D $haystack, Str:D $needle, Int $startpos = $haystack.chars --> Int)
Expand Down

0 comments on commit e60d9eb

Please sign in to comment.