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

Method trimLeadingFrom

output/java_guava/1.4.18/CharMatcher.java:943–951  ·  view source on GitHub ↗

Returns a substring of the input character sequence that omits all characters this matcher matches from the beginning of the string. For example: CharMatcher.anyOf("ab").trimLeadingFrom("abacatbab") ... returns "catbab".

(CharSequence sequence)

Source from the content-addressed store, hash-verified

941
942
943 public String trimLeadingFrom(CharSequence sequence) {
944 int len = sequence.length();
945 for (int first = 0; first < len; first++) {
946 if (!matches(sequence.charAt(first))) {
947 return sequence.subSequence(first, len).toString();
948 }
949 }
950 return "";
951 }
952
953 /**
954 * Returns a substring of the input character sequence that omits all characters this matcher

Callers 1

getSimpleNameMethod · 0.45

Calls 3

matchesMethod · 0.95
toStringMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected