Documentation ¶
Overview ¶
Suite of string formatting utilities.
Index ¶
- type Commands
- func (self *Commands) Autotype(input interface{}) (interface{}, error)
- func (self *Commands) Camelize(input interface{}) (string, error)
- func (self *Commands) Codepoints(input interface{}) ([]int, error)
- func (self *Commands) Format(pattern string, args *FormatArgs) (string, error)
- func (self *Commands) Join(inputs interface{}, args *JoinArgs) (string, error)
- func (self *Commands) Lcp(inputs interface{}) (string, error)
- func (self *Commands) Lower(input interface{}) (string, error)
- func (self *Commands) Pascalize(input interface{}) (string, error)
- func (self *Commands) Replace(input interface{}, args *ReplaceArgs) (string, error)
- func (self *Commands) Split(input interface{}, args *SplitArgs) ([]string, error)
- func (self *Commands) Strip(input interface{}) (string, error)
- func (self *Commands) Title(input interface{}) (string, error)
- func (self *Commands) Trim(input interface{}, args *TrimArgs) (string, error)
- func (self *Commands) Underscore(input interface{}) (string, error)
- func (self *Commands) Upper(input interface{}) (string, error)
- type FormatArgs
- type JoinArgs
- type ReplaceArgs
- type SplitArgs
- type TrimArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commands ¶
func (*Commands) Autotype ¶
Takes an input value and returns that value as the most appropriate data type based on its contents.
func (*Commands) Codepoints ¶ added in v0.6.4
Return an array of Unicode codepoints for each character in the given string.
func (*Commands) Format ¶
func (self *Commands) Format(pattern string, args *FormatArgs) (string, error)
Format the given string according to the given pattern and values.
func (*Commands) Join ¶
Join an array of inputs into a single string, with each item separated by a given joiner string.
func (*Commands) Replace ¶
func (self *Commands) Replace(input interface{}, args *ReplaceArgs) (string, error)
Replaces values in an input string (exact matches or regular expressions) with a replacement value. Exact matches will be replaced up to a certain number of times, or all occurrences of count is -1 (default).
func (*Commands) Underscore ¶
Return the given string converted to underscore_case.
type FormatArgs ¶
type FormatArgs struct {
Data interface{} `json:"data"`
}