RosettaCodeData/Task/String-matching/Perl/string-matching-5.pl

2 lines
89 B
Perl
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
my $i = -1; print $i, "\n" while ($i = index $str1, $str2, $i + 1) != -1; # using index