RosettaCodeData/Task/String-matching/Perl-6/string-matching-3.pl6
2016-12-05 22:15:40 +01:00

2 lines
174 B
Raku

substr($haystack, 0, $needle.chars) eq $needle # True if $haystack starts with $needle
substr($haystack, *-$needle.chars) eq $needle # True if $haystack ends with $needle