use strict; use warnings; use 5.010; my $str = "The black cat climbed the green tree"; say rindex $str, "e"; # 35 say rindex $str, "e", 34; # 34 say rindex $str, "e", 33; # 29
It is like the index function but starts searching from the right-hand side. See also the explanation in String functions: length, lc, uc, index, substr.
Published on 2020-05-16
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub. Comment on this post