Documentation
¶
Index ¶
- func Digit() digit
- func Letter() letter
- func Not(p predicate) not
- func Or(p ...predicate) or
- func String(needle string) startsWith
- func Whitespace() whitespace
- type StringView
- func (view *StringView) Length() int
- func (view *StringView) Peak(p predicate) *StringView
- func (view *StringView) PeakNext(p predicate) *StringView
- func (view *StringView) Seek(p predicate) *StringView
- func (view *StringView) SeekEndOf(p predicate) *StringView
- func (view *StringView) SeekNext(p predicate) *StringView
- func (view *StringView) SplitOnNext(p predicate) *StringView
- func (view *StringView) String() string
- func (view *StringView) Take(n int) *StringView
- func (view *StringView) TakeLine() *StringView
- func (view *StringView) TakeUntil(p predicate) *StringView
- func (view *StringView) TakeUntilNext(p predicate) *StringView
- func (view *StringView) TrimLeft()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Whitespace ¶
func Whitespace() whitespace
Types ¶
type StringView ¶
type StringView struct {
// contains filtered or unexported fields
}
func New ¶
func New(s *string) *StringView
func (*StringView) Length ¶
func (view *StringView) Length() int
func (*StringView) Peak ¶
func (view *StringView) Peak(p predicate) *StringView
Finds and returns the string from the current posision to the location of the first match of the predicate.
> Does not advance the offset
As with `StringView.Seek` this will search the current posision too. Consequentlely if the predicate matches the current posision, the resulting string will be empty.
func (*StringView) PeakNext ¶
func (view *StringView) PeakNext(p predicate) *StringView
Finds and returns the string from the current posision to the location of the next match of the predicate.
> Does not advance the offset
func (*StringView) Seek ¶
func (view *StringView) Seek(p predicate) *StringView
Seeks the provided predicate in the string.
If the predicate matches the current posision in the string, this does nothing
func (*StringView) SeekEndOf ¶
func (view *StringView) SeekEndOf(p predicate) *StringView
Seeks the provided predicate in the string.
If the predicate matches the current posision in the string, this does nothing
func (*StringView) SeekNext ¶
func (view *StringView) SeekNext(p predicate) *StringView
Seeks for the provided predicate in the string at any subsequent posision.
func (*StringView) SplitOnNext ¶
func (view *StringView) SplitOnNext(p predicate) *StringView
func (*StringView) String ¶
func (view *StringView) String() string
func (*StringView) Take ¶
func (view *StringView) Take(n int) *StringView
func (*StringView) TakeLine ¶
func (view *StringView) TakeLine() *StringView
Returns the result of `TakeUntil` any newline character, then `Seek` until the next non-empty line
func (*StringView) TakeUntil ¶
func (view *StringView) TakeUntil(p predicate) *StringView
Finds and returns the string from the current posision to the location of the first match of the predicate.
As with `StringView.Seek` this will search the current posision too. Consequentlely if the predicate matches the current posision, the resulting string will be empty.
func (*StringView) TakeUntilNext ¶
func (view *StringView) TakeUntilNext(p predicate) *StringView
Finds and returns the string from the current posision to the location of the first match of the predicate.
func (*StringView) TrimLeft ¶
func (view *StringView) TrimLeft()
Trims away any whitespace from the left of the string.