RosettaCodeData/Task/String-matching/Perl/string-matching-1.pl
2023-07-01 13:44:08 -04:00

3 lines
166 B
Raku

$str1 =~ /^\Q$str2\E/ # true if $str1 starts with $str2
$str1 =~ /\Q$str2\E/ # true if $str1 contains $str2
$str1 =~ /\Q$str2\E$/ # true if $str1 ends with $str2