Documentation ¶
Index ¶
- func Bool(str string) bool
- func Float64(str string) float64
- func Int(str string) int
- func IsEmpty(str string) bool
- func SplitLines(str string) []string
- func SplitSpaces(str string) []string
- type Str
- func (s *Str) Bool() bool
- func (s *Str) Bytes() []byte
- func (s *Str) Concat(vals ...string) *Str
- func (s *Str) CopyTo(dest io.Writer) *Str
- func (s *Str) Eq(val1 string) bool
- func (s *Str) Err() error
- func (s *Str) Float64() float64
- func (s *Str) Int() int
- func (s *Str) IsEmpty() bool
- func (s *Str) Reader() io.Reader
- func (s *Str) ReplaceAll(old, new string) *Str
- func (s *Str) Split(sep string) []string
- func (s *Str) SplitLines() []string
- func (s *Str) SplitRegex(exp string) []string
- func (s *Str) SplitSpaces() []string
- func (s *Str) String() string
- func (s *Str) ToLower() *Str
- func (s *Str) ToTitle() *Str
- func (s *Str) ToUpper() *Str
- func (s *Str) Trim(cutset string) *Str
- func (s *Str) TrimLeft(cutset string) *Str
- func (s *Str) TrimRight(cutset string) *Str
- func (s *Str) TrimSpaces() *Str
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool returns the bool equivalent of str ("true" = true, etc) A parsing error will cause a program panic.
func Float64 ¶
Float64 returns the float64 representation of str. A parsing error will cause a program panic.
func SplitLines ¶
SplitLines splits each line from str into []string
func SplitSpaces ¶
SplitSpaces splits str by blank chars (space,\t,\n)
Types ¶
type Str ¶
type Str struct {
// contains filtered or unexported fields
}
Str represents a string value
func StringWithVars ¶ added in v0.3.0
StringWithVars sets session variables and calls func String
func (*Str) Bool ¶
Bool converts s.val from string to a bool representation Check s.Err() for parsing errors
func (*Str) Float64 ¶
Float64 converts s.val from string to a float64 representation Check s.Error() for parsing errors
func (*Str) Int ¶
Int converts s.val from string to a int representation Check s.Err() for parsing errors
func (*Str) ReplaceAll ¶
ReplaceAll replaces all occurrences of old with new in s.val
func (*Str) SplitLines ¶
SplitLines splits s.val using \n as delimiter
func (*Str) SplitRegex ¶
SplitRegex uses regular expression exp to split s.val
func (*Str) SplitSpaces ¶
SplitSpaces properly splits s.val into []elements separated by one or more Unicode.IsSpace characters i.e. SplitSpaces("ab cd e\tf\ng") returns 5 elements