RosettaCodeData/Task/String-matching/Perl/string-matching-1.pl
2015-02-20 09:02:09 -05: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