Help for this page

Select Code to Download


  1. or download this
    my $last_digit = 5;
    if ($last_digit == substr $number, -1) {
        print "Matches!\n"
    }
    
  2. or download this
    if (rindex($number, $last_digit) == length($number) - 1) {
        print "Matches!\n"
    }