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)
| 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 |
no test coverage detected