Documentation ¶
Index ¶
- type Stringish
- func (s *Stringish) Contains(str string) bool
- func (s *Stringish) Equals(str string) bool
- func (s *Stringish) Filter(filterer func(string) bool) *Stringish
- func (s *Stringish) GetString() string
- func (s *Stringish) HasPrefix(prefix string) bool
- func (s *Stringish) HasSuffix(suffix string) bool
- func (s *Stringish) Index(str string) int
- func (s *Stringish) IsBlank() bool
- func (s *Stringish) IsEmpty() bool
- func (s *Stringish) LastIndex(str string) int
- func (s *Stringish) Len() int
- func (s *Stringish) Map(mapper func(string) string) *Stringish
- func (s *Stringish) ReplaceAll(old, new string) *Stringish
- func (s *Stringish) ReplaceN(old, new string, count int) *Stringish
- func (s *Stringish) ToLower() *Stringish
- func (s *Stringish) ToUpper() *Stringish
- func (s *Stringish) TrimPrefix(prefix string) *Stringish
- func (s *Stringish) TrimPrefixSpaces() *Stringish
- func (s *Stringish) TrimSpaces() *Stringish
- func (s *Stringish) TrimSuffix(suffix string) *Stringish
- func (s *Stringish) TrimSuffixSpaces() *Stringish
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stringish ¶
type Stringish struct {
// contains filtered or unexported fields
}
Stringish is the main exposed type with all implemented methods
func NewFromByteSlice ¶
NewFromByteSlice creates an instance of Stringish from a slice of bytes and returns a pointer to it
func (*Stringish) Filter ¶
Filter runs filterer on characters of the string and holds the character if the filterer returns true
func (*Stringish) Index ¶
Index returns the index of first occurrence of str in string (-1 if no occurrence found)
func (*Stringish) IsBlank ¶
IsBlank returns true if string is blank (equal to "" or some space chars like " ")
func (*Stringish) LastIndex ¶
LastIndex returns the index of last occurrence of str in string (-1 if no occurrence found)
func (*Stringish) Map ¶
Map maps every character of string with given function and replace them with return value of the function
func (*Stringish) ReplaceAll ¶
ReplaceAll replaces all occurrences of old with new
func (*Stringish) TrimPrefix ¶
TrimPrefix trims prefix from the start of the string
func (*Stringish) TrimPrefixSpaces ¶
TrimPrefixSpaces trims space characters from the start of the string
func (*Stringish) TrimSpaces ¶
TrimSpaces trims space characters from both sides of the string
func (*Stringish) TrimSuffix ¶
TrimSuffix trims suffix from the end of the string
func (*Stringish) TrimSuffixSpaces ¶
TrimSuffixSpaces trims space characters from the end of the string