Interface CharMatcher

    • Method Detail

      • anyOf

        static CharMatcher anyOf​(@NonNull
                                 @NonNull CharSequence characters)
        Matches against any character in the given sequence.s
        Parameters:
        characters - the characters
        Returns:
        the char matcher
      • findIn

        default int findIn​(@NonNull
                           @NonNull CharSequence sequence)
        Finds the first character in the given sequence that matches.
        Parameters:
        sequence - the sequence
        Returns:
        the index of the first match or -1 if none
      • findIn

        default int findIn​(@NonNull
                           @NonNull CharSequence sequence,
                           int offset)
        Finds the first character in the given sequence that matches.
        Parameters:
        sequence - the sequence
        offset - the starting position to search in the CharSequence
        Returns:
        the index of the first match or -1 if none
      • matchesAllOf

        default boolean matchesAllOf​(@NonNull
                                     @NonNull CharSequence sequence)
        Checks if the entire CharSequence matches.
        Parameters:
        sequence - the sequence
        Returns:
        True if this matcher matches all of the given CharSequence
      • matchesAnyOf

        default boolean matchesAnyOf​(@NonNull
                                     @NonNull CharSequence sequence)
        Checks if any of the CharSequence matches.
        Parameters:
        sequence - the sequence
        Returns:
        True if this matcher matches any of the given CharSequence
      • matchesNoneOf

        default boolean matchesNoneOf​(@NonNull
                                      @NonNull CharSequence sequence)
        Checks if none of the CharSequence matches.
        Parameters:
        sequence - the sequence
        Returns:
        True if this matcher matches none of the given CharSequence
      • trimFrom

        default String trimFrom​(@NonNull
                                @NonNull CharSequence sequence)
        Removes matches from the beginning and end of the string.
        Parameters:
        sequence - the sequence
        Returns:
        the trimmed string
      • trimLeadingFrom

        default String trimLeadingFrom​(@NonNull
                                       @NonNull CharSequence sequence)
        Removes matches from the beginning of the string until a non-match is found.
        Parameters:
        sequence - the sequence
        Returns:
        the trimmed string
      • trimTrailingFrom

        default String trimTrailingFrom​(@NonNull
                                        @NonNull CharSequence sequence)
        Trims matches from the end of the string until a non-match is found.
        Parameters:
        sequence - the sequence
        Returns:
        the trimmed string