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

3 lines
174 B
Raku
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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