Returns the index of the last matching character in a character sequence, or -1 if no matching character is present. The default implementation iterates over the sequence in reverse order calling #matches for each character. @param sequence the character sequence to examine from
(CharSequence sequence)
| 741 | |
| 742 | |
| 743 | public int lastIndexIn(CharSequence sequence) { |
| 744 | for (int i = sequence.length() - 1; i >= 0; i--) { |
| 745 | if (matches(sequence.charAt(i))) { |
| 746 | return i; |
| 747 | } |
| 748 | } |
| 749 | return -1; |
| 750 | } |
| 751 | |
| 752 | /** |
| 753 | * Returns the number of matching characters found in a character sequence. |