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

Method trimLeadingFrom

output/java_guava/1.4.13/CharMatcher.java:944–952  ·  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

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

Callers

nothing calls this directly

Calls 3

matchesMethod · 0.95
toStringMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected