Documentation ¶
Index ¶
- Variables
- func Contains(list []string, str string) bool
- func ContainsAny(s string, runes ...rune) bool
- func ContainsWhiteSpace(s string) bool
- func Filter(s string, filter func(r rune) bool) string
- func FirstN(s string, n int, ellipsis ...string) string
- func HasEmpty(args ...string) bool
- func NotEmpty(args ...string) bool
- func Remove(strings []string, strs ...string) []string
- func Reverse(s string) string
- func Substr(str string, start, stop int) (string, error)
- func TakeOne(valid, or string) string
- func TakeWithPriority(fns ...func() string) string
- func Union(first, second []string) []string
- type String
- func (s String) IsEmptyOrSpace() bool
- func (s String) Lower() string
- func (s String) ReplaceAll(old, new string) string
- func (s String) Source() string
- func (s String) Title() string
- func (s String) ToCamel() string
- func (s String) ToSnake() string
- func (s String) Untitle() string
- func (s String) Upper() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidStartPosition is an error that indicates the start position is invalid. ErrInvalidStartPosition = errors.New("start position is invalid") // ErrInvalidStopPosition is an error that indicates the stop position is invalid. ErrInvalidStopPosition = errors.New("stop position is invalid") )
View Source
var WhiteSpace = []rune{'\n', '\t', '\f', '\v', ' '}
Functions ¶
func ContainsAny ¶
func ContainsWhiteSpace ¶
func Substr ¶
Substr returns runes between start and stop [start, stop) regardless of the chars are ascii or utf8.
func TakeWithPriority ¶
TakeWithPriority returns the first not empty result from fns.
Types ¶
type String ¶
type String struct {
// contains filtered or unexported fields
}
String provides for converting the source text into other spell case,like lower,snake,camel
func (String) IsEmptyOrSpace ¶
IsEmptyOrSpace returns true if the length of the string value is 0 after call strings.TrimSpace, or else returns false
func (String) ReplaceAll ¶
ReplaceAll calls the strings.ReplaceAll
Click to show internal directories.
Click to hide internal directories.