MCPcopy Create free account
hub / github.com/antlr/codebuff / lastIndexIn

Method lastIndexIn

corpus/java/training/guava/base/CharMatcher.java:665–672  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

663 * @return an index, or {@code -1} if no character matches
664 */
665 public int lastIndexIn(CharSequence sequence) {
666 for (int i = sequence.length() - 1; i >= 0; i--) {
667 if (matches(sequence.charAt(i))) {
668 return i;
669 }
670 }
671 return -1;
672 }
673
674 /**
675 * Returns the number of matching characters found in a character sequence.

Callers

nothing calls this directly

Calls 2

matchesMethod · 0.95
lengthMethod · 0.45

Tested by

no test coverage detected