RosettaCodeData/Task/String-matching/Raku/string-matching-3.raku

3 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