Permalink
Browse files

Minor changes and elimination of definitions

  • Loading branch information...
JJ committed Jan 12, 2019
1 parent 23fb530 commit e60d9ebe32dde1b3a79b733b64ab71ebbdbdda87
Showing with 10 additions and 5 deletions.
  1. +10 −5 doc/Type/Str.pod6
@@ -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:
@@ -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)

0 comments on commit e60d9eb

Please sign in to comment.