Skip to content

Commit cbfb05c

Browse files
committed
Document Str.contains
1 parent 7ea3658 commit cbfb05c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/Type/Str.pod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,16 @@ Returns True if the invocant is identical to or ends with C<$needle>.
392392
say "Hello, World".ends-with('Hello'); # False
393393
say "Hello, World".ends-with('ld'); # True
394394
395+
=head2 method contains
396+
397+
multi method contains(Str:D: Str(Cool) $needle) returns True:D
398+
399+
Returns True if the invocant contains the C<$needle> at any position within
400+
the string.
401+
402+
say "Hello, World".contains('hello'); # False
403+
say "Hello, World".contains(','); # True
404+
395405
=head2 method subst
396406
397407
multi method subst(Str:D: $matcher, $replacement, *%opts)

0 commit comments

Comments
 (0)