Get the rindex : rindex « String « Perl






Get the rindex

   

$text = "I said, no.";

print "First occurence of \"no\" is at position: " . index($text, "no") . "\n";
print "Last occurence of \"no\" is at position: " . rindex($text, "no") . "\n";

   
    
    
  

Related examples in the same category