Documentation ¶
Index ¶
- Variables
- func CenterString(s string, width int) string
- func Concat(objects ...interface{}) string
- func ConvertData(data string, out interface{}) (err error)
- func Default(value, defaultValue interface{}) interface{}
- func IIf(testValue, valueTrue, valueFalse interface{}) interface{}
- func IfUndef(def interface{}, values ...interface{}) interface{}
- func Indent(s, indent string) string
- func IndentN(s string, indent int) string
- func Interface2string(str interface{}) string
- func IsEmptyValue(v reflect.Value) bool
- func IsExported(id string) bool
- func JoinLines(objects ...interface{}) string
- func LoadData(filename string, out interface{}) (err error)
- func PrettyPrintStruct(object interface{}) string
- func Split2(source, sep string) (left, right string)
- func SplitLines(content interface{}) []interface{}
- func ToBash(value interface{}) string
- func ToInterfaces(values ...string) []interface{}
- func ToNativeRepresentation(value interface{}) interface{}
- func UnIndent(s string) string
- func WrapString(s string, width int) string
- type IDictionary
- type IDictionaryHelper
- type IGenericList
- type IListHelper
- type String
- func (s String) AddLineNumber(space int) String
- func (s String) Center(width int) String
- func (s String) Compare(b string) int
- func (s String) Contains(substr string) bool
- func (s String) ContainsAny(chars string) bool
- func (s String) ContainsRune(r rune) bool
- func (s String) Count(substr string) int
- func (s String) EqualFold(t string) bool
- func (s String) Escape() String
- func (s String) Fields() StringArray
- func (s String) FieldsFunc(f func(rune) bool) StringArray
- func (s String) FieldsID() StringArray
- func (s String) GetContextAtPosition(pos int, left, right string) (a String, b int)
- func (s String) GetWordAtPosition(pos int, accept ...string) (String, int)
- func (s String) HasPrefix(prefix string) bool
- func (s String) HasSuffix(suffix string) bool
- func (s String) Indent(indent string) String
- func (s String) IndentN(indent int) String
- func (s String) Index(substr string) int
- func (s String) IndexAll(substr string) (result []int)
- func (s String) IndexAny(chars string) int
- func (s String) IndexByte(c byte) int
- func (s String) IndexFunc(f func(rune) bool) int
- func (s String) IndexRune(r rune) int
- func (s String) Join(array ...interface{}) String
- func (s String) LastIndex(substr string) int
- func (s String) LastIndexAny(chars string) int
- func (s String) LastIndexByte(c byte) int
- func (s String) LastIndexFunc(f func(rune) bool) int
- func (s String) Len() int
- func (s String) Lines() StringArray
- func (s String) Map(mapping func(rune) rune) String
- func (s String) ParseBool() bool
- func (s String) Protect() (result String, array StringArray)
- func (s String) Quote() String
- func (s String) Repeat(count int) String
- func (s String) Replace(old, new string) String
- func (s String) ReplaceN(old, new string, n int) String
- func (s String) RestoreProtected(array StringArray) String
- func (s String) SelectContext(pos int, left, right string) String
- func (s String) SelectWord(pos int, accept ...string) String
- func (s String) Split(sep string) StringArray
- func (s String) SplitAfter(sep string) StringArray
- func (s String) SplitAfterN(sep string, n int) StringArray
- func (s String) SplitN(sep string, n int) StringArray
- func (s String) Str() string
- func (s String) String() string
- func (s String) Title() String
- func (s String) ToLower() String
- func (s String) ToLowerSpecial(c unicode.SpecialCase) String
- func (s String) ToTitle() String
- func (s String) ToTitleSpecial(c unicode.SpecialCase) String
- func (s String) ToUpper() String
- func (s String) ToUpperSpecial(c unicode.SpecialCase) String
- func (s String) Trim(cutset string) String
- func (s String) TrimFunc(f func(rune) bool) String
- func (s String) TrimLeft(cutset string) String
- func (s String) TrimLeftFunc(f func(rune) bool) String
- func (s String) TrimPrefix(prefix string) String
- func (s String) TrimRight(cutset string) String
- func (s String) TrimRightFunc(f func(rune) bool) String
- func (s String) TrimSpace() String
- func (s String) TrimSuffix(suffix string) String
- func (s String) UnIndent() String
- func (s String) Wrap(width int) String
- type StringArray
- func (as StringArray) Center(width int) StringArray
- func (as StringArray) Indent(indent string) StringArray
- func (as StringArray) IndentN(indent int) StringArray
- func (as StringArray) Join(sep interface{}) String
- func (as StringArray) Sorted() StringArray
- func (as StringArray) Str() []string
- func (as StringArray) Strings() []string
- func (as StringArray) Title() StringArray
- func (as StringArray) ToLower() StringArray
- func (as StringArray) ToLowerSpecial(c unicode.SpecialCase) StringArray
- func (as StringArray) ToTitle() StringArray
- func (as StringArray) ToTitleSpecial(c unicode.SpecialCase) StringArray
- func (as StringArray) ToUpper() StringArray
- func (as StringArray) ToUpperSpecial(c unicode.SpecialCase) StringArray
- func (as StringArray) Trim(cutset string) StringArray
- func (as StringArray) TrimFunc(f func(rune) bool) StringArray
- func (as StringArray) TrimLeft(cutset string) StringArray
- func (as StringArray) TrimLeftFunc(f func(rune) bool) StringArray
- func (as StringArray) TrimPrefix(prefix string) StringArray
- func (as StringArray) TrimRight(cutset string) StringArray
- func (as StringArray) TrimRightFunc(f func(rune) bool) StringArray
- func (as StringArray) TrimSpace() StringArray
- func (as StringArray) TrimSuffix(suffix string) StringArray
- func (as StringArray) UnIndent() StringArray
- func (as StringArray) Wrap(width int) StringArray
- Bugs
Constants ¶
This section is empty.
Variables ¶
var ToStrings = sprig.GenericFuncMap()["toStrings"].(func(interface{}) []string)
ToStrings converts the supplied parameter into an array of string.
var TypeConverters = make(map[string]func([]byte, interface{}) error)
TypeConverters is used to register the available converters
Functions ¶
func CenterString ¶
CenterString returns string s centered within width
func Concat ¶
func Concat(objects ...interface{}) string
Concat returns a string with all string representation of object concatenated without space.
func ConvertData ¶
ConvertData returns a go representation of the supplied string (YAML, JSON or HCL)
func Default ¶
func Default(value, defaultValue interface{}) interface{}
Default returns the value if it is not empty or default value.
func IIf ¶
func IIf(testValue, valueTrue, valueFalse interface{}) interface{}
IIf acts as a generic ternary operator. It returns valueTrue if testValue is not empty, otherwise, it returns valueFalse
func IfUndef ¶
func IfUndef(def interface{}, values ...interface{}) interface{}
IfUndef returns default value if nothing is supplied as values
func IndentN ¶
IndentN returns the indented version (indent as a number of spaces) of the supplied string.
func Interface2string ¶
func Interface2string(str interface{}) string
Interface2string returns the string representation of any interface.
func IsEmptyValue ¶
IsEmptyValue determines if a value is a zero value
func IsExported ¶
IsExported reports whether the identifier is exported.
func JoinLines ¶
func JoinLines(objects ...interface{}) string
JoinLines concatenate the representation of supplied arguments as a string separated by newlines.
func PrettyPrintStruct ¶
func PrettyPrintStruct(object interface{}) string
PrettyPrintStruct returns a readable version of an object.
func SplitLines ¶
func SplitLines(content interface{}) []interface{}
SplitLines return a list of interface object for each line in the supplied content.
func ToBash ¶
func ToBash(value interface{}) string
ToBash returns the bash 4 variable representation of value
func ToInterfaces ¶
func ToInterfaces(values ...string) []interface{}
ToInterfaces converts an array of strings into an array of interfaces
func ToNativeRepresentation ¶
func ToNativeRepresentation(value interface{}) interface{}
ToNativeRepresentation converts any object to native (literals, maps, slices)
func UnIndent ¶
UnIndent returns the unindented version of the supplied string only if all lines are prefixed with the same pattern of spaces.
func WrapString ¶
WrapString wraps long string according to the supplied width
Types ¶
type IDictionary ¶
type IDictionary interface { Add(key, value interface{}) IDictionary // Add value to key (if key exist, convert the key value into list and append the new value). AsMap() map[string]interface{} // Returns the object casted as map[string]interface{}. Clone(...interface{}) IDictionary // Returns a distinct copy of the object with only supplied keys. If no keys are supplied, all keys from d are copied. Count() int // Simply an alias for Len. Create(...int) IDictionary // Instantiates a new dictionary of the same type with optional size. CreateList(...int) IGenericList // Instantiates a list of the same type as current dictionary with optional size and capacity. Default(key, defVal interface{}) interface{} // Returns defVal if dictionary doesn't contain key, otherwise, simply returns entry corresponding to key. Delete(interface{}, ...interface{}) (IDictionary, error) // Removes the entry value associated with key. The entry must exist. Flush(...interface{}) IDictionary // Removes all specified keys from the dictionary. If no key is specified, all keys are removed. Get(...interface{}) interface{} // Returns the values associated with key. GetHelpers() (IDictionaryHelper, IListHelper) // Returns the helpers implementation associated with the current type. GetKeys() IGenericList // Returns the keys in the dictionary in alphabetical order. GetValues() IGenericList // Returns the values in the dictionary in alphabetical order of keys. Has(...interface{}) bool // Returns true if the dictionary object contains all the key. KeysAsString() StringArray // Returns the keys in the dictionary in alphabetical order. Len() int // Returns the number of keys in the dictionary. Merge(IDictionary, ...IDictionary) IDictionary // Merges the other dictionaries into the current dictionary. Native() interface{} // Returns the object casted as native go type (applied recursively). Omit(interface{}, ...interface{}) IDictionary // Returns a distinct copy of the object including all keys except specified ones. Pop(...interface{}) interface{} // Returns and remove the objects with the specified keys. PrettyPrint() string // Returns the pretty string representation of the dictionary. Set(key, value interface{}) IDictionary // Sets key to value in the dictionary. String() string // Returns the string representation of the dictionary. Transpose() IDictionary // Transpose keys/values and return the resulting dictionary TypeName() String // Returns the actual type name }
IDictionary represents objects that act as map[string]interface.
func AsDictionary ¶
func AsDictionary(object interface{}) IDictionary
AsDictionary returns the object casted as IDictionary.
func CreateDictionary ¶
func CreateDictionary(size ...int) IDictionary
CreateDictionary instantiates a new dictionary with optional size.
func TryAsDictionary ¶
func TryAsDictionary(object interface{}) (IDictionary, error)
TryAsDictionary returns the object casted as IDictionary if possible.
type IDictionaryHelper ¶
type IDictionaryHelper interface { AsDictionary(interface{}) IDictionary // Returns the object casted as IDictionary. Convert(object interface{}) interface{} // Tries to convert the supplied object into IDictionary or IGenericList. CreateDictionary(args ...int) IDictionary // Creates a new IDictionary with optional capacity arguments. TryAsDictionary(object interface{}) (IDictionary, error) // Tries to convert any object to IDictionary objects TryConvert(object interface{}) (interface{}, bool) // Tries to convert any object to IGenericList or IDictionary object. }
IDictionaryHelper represents objects that implement IDictionary compatible objects
var DictionaryHelper IDictionaryHelper
DictionaryHelper configures the default dictionary manager.
type IGenericList ¶
type IGenericList interface { Append(...interface{}) IGenericList // Add elements to the current list. If list is not large enough, it is enlarged to fit the required size. AsArray() []interface{} // Returns the current list as standard array of interface{}. Cap() int // Returns the capacity of the list. Capacity() int // Simply an alias for Cap. Clone() IGenericList // Returns a distinct copy of the object. Contains(...interface{}) bool // Indicates if the list contains all specified elements Count() int // Simply an alias for Len. Create(...int) IGenericList // Allocates a new list of the same type implementation as this list. Optional arguments are size and capacity. CreateDict(...int) IDictionary // Instantiates a new dictionary of the same type with optional size. First() interface{} // Returns the first element of the list. Get(...int) interface{} // Returns the element at position index in the list. If index is out of bound, nil is returned. GetHelpers() (IDictionaryHelper, IListHelper) // Returns the helpers implementation associated with the current type. Has(...interface{}) bool // Alias for contains Intersect(...interface{}) IGenericList // Returns a list that is the result of the intersection of the list and the parameters (removing duplicates). Join(sep interface{}) String // Returns the string representation of the list. Last() interface{} // Returns the last element of the list. Len() int // Returns the number of elements in the list. New(...interface{}) IGenericList // Creates a new generic list from the supplied arguments. Pop(indexes ...int) (interface{}, IGenericList) // Removes and returns the elements of the list (if nothing is specified, remove the last element). Prepend(...interface{}) IGenericList // Add elements to the beginning of the current list. If list is not large enough, it is enlarged to fit the required size. PrettyPrint() string // Returns the pretty string representation of the list. Remove(indexes ...int) IGenericList // Returns a new list without the element specified. Reverse() IGenericList // Returns a copy of the current list in reverse order. Set(index int, value interface{}) (IGenericList, error) // Sets the value at position index into the list. If list is not large enough, it is enlarged to fit the index. String() string // Returns the string representation of the list. StringArray() StringArray // Returns the current list as StringArray. Strings() []string // Returns the current list as list of strings. TypeName() String // Returns the actual type name Union(...interface{}) IGenericList // Returns a list that represents the union of the list and the elements (removing duplicates). Unique() IGenericList // Returns a copy of the list removing all duplicate elements. Without(...interface{}) IGenericList // Returns a copy of the list removing specified elements. }
IGenericList represents objects that act as []interface{}.
func AsList ¶
func AsList(object interface{}) IGenericList
AsList returns the object casted as IGenericList.
func CreateList ¶
func CreateList(args ...int) IGenericList
CreateList instantiates a new generic list with optional size and capacity.
func NewList ¶
func NewList(objects ...interface{}) IGenericList
NewList instantiates a new generic list from supplied arguments.
func NewStringList ¶
func NewStringList(objects ...string) IGenericList
NewStringList creates a new IGenericList from supplied arguments.
func TryAsList ¶
func TryAsList(object interface{}) (IGenericList, error)
TryAsList returns the object casted as IGenericList if possible.
type IListHelper ¶
type IListHelper interface { AsList(interface{}) IGenericList // Converts object to IGenericList object. It panics if conversion is impossible. Convert(object interface{}) interface{} // Tries to convert the supplied object into IDictionary or IGenericList. CreateList(...int) IGenericList // Creates a new IGenericList with optional size/capacity arguments. NewList(...interface{}) IGenericList // Creates a new IGenericList from supplied arguments. NewStringList(...string) IGenericList // Creates a new IGenericList from supplied arguments. TryAsList(object interface{}) (IGenericList, error) // Tries to convert any object to IGenericList object. TryConvert(object interface{}) (interface{}, bool) // Tries to convert any object to IGenericList or IDictionary object. }
IListHelper represents objects that implement IGenericList compatible objects
var ListHelper IListHelper
ListHelper configures the default list manager.
type String ¶
type String string
String is an enhanced class implementation of the standard go string library. This is convenient when manipulating go template string to have it considered as an object.
func (String) AddLineNumber ¶
AddLineNumber adds line number to a string
func (String) Compare ¶
Compare returns an integer comparing two strings lexicographically. The result will be 0 if a==b, -1 if a < b, and +1 if a > b.
func (String) ContainsAny ¶
ContainsAny reports whether any Unicode code points in chars are within s.
func (String) ContainsRune ¶
ContainsRune reports whether the Unicode code point r is within s.
func (String) Count ¶
Count counts the number of non-overlapping instances of substr in s. If substr is an empty string, Count returns 1 + the number of Unicode code points in s.
func (String) EqualFold ¶
EqualFold reports whether s and t, interpreted as UTF-8 strings, are equal under Unicode case-folding.
func (String) Fields ¶
func (s String) Fields() StringArray
Fields splits the string s around each instance of one or more consecutive white space characters, as defined by unicode.IsSpace, returning an array of substrings of s or an empty list if s contains only white space.
func (String) FieldsFunc ¶
func (s String) FieldsFunc(f func(rune) bool) StringArray
FieldsFunc splits the string s at each run of Unicode code points c satisfying f(c) and returns an array of slices of s. If all code points in s satisfy f(c) or the string is empty, an empty slice is returned. FieldsFunc makes no guarantees about the order in which it calls f(c). If f does not return consistent results for a given c, FieldsFunc may crash.
func (String) FieldsID ¶
func (s String) FieldsID() StringArray
FieldsID splits the string s at character that is not a valid identifier character (letter, digit or underscore).
func (String) GetContextAtPosition ¶
GetContextAtPosition tries to extend the context from the specified position within specified boundaries.
func (String) GetWordAtPosition ¶
GetWordAtPosition returns the selected word and the start position from the specified position.
func (String) Indent ¶
Indent returns the indented version of the supplied string (indent represents the string used to indent the lines).
func (String) IndentN ¶
IndentN returns the indented version of the supplied string (indent represents the number of spaces used to indent the lines).
func (String) Index ¶
Index returns the index of the first instance of substr in s, or -1 if substr is not present in s.
func (String) IndexAny ¶
IndexAny returns the index of the first instance of any Unicode code point from chars in s, or -1 if no Unicode code point from chars is present in s.
func (String) IndexByte ¶
IndexByte returns the index of the first instance of c in s, or -1 if c is not present in s.
func (String) IndexFunc ¶
IndexFunc returns the index into s of the first Unicode code point satisfying f(c), or -1 if none do.
func (String) IndexRune ¶
IndexRune returns the index of the first instance of the Unicode code point r, or -1 if rune is not present in s. If r is utf8.RuneError, it returns the first instance of any invalid UTF-8 byte sequence.
func (String) Join ¶
Join concatenates the elements of array to create a single string. The string object is placed between elements in the resulting string.
func (String) LastIndex ¶
LastIndex returns the index of the last instance of substr in s, or -1 if substr is not present in s.
func (String) LastIndexAny ¶
LastIndexAny returns the index of the last instance of any Unicode code point from chars in s, or -1 if no Unicode code point from chars is present in s.
func (String) LastIndexByte ¶
LastIndexByte returns the index of the last instance of c in s, or -1 if c is not present in s.
func (String) LastIndexFunc ¶
LastIndexFunc returns the index into s of the last Unicode code point satisfying f(c), or -1 if none do.
func (String) Lines ¶
func (s String) Lines() StringArray
Lines splits up s into a StringArray using the newline as character separator
func (String) Map ¶
Map returns a copy of the string s with all its characters modified according to the mapping function. If mapping returns a negative value, the character is dropped from the string with no replacement.
func (String) ParseBool ¶
ParseBool returns true if variable exist and is not clearly a false value
i.e. empty, 0, Off, No, n, false, f
func (String) Protect ¶
func (s String) Protect() (result String, array StringArray)
Protect returns a string with all included strings replaced by a token and an array of all replaced strings. The function is able to detect strings enclosed between quotes "" or backtick “ and it detects escaped characters.
func (String) Repeat ¶
Repeat returns a new string consisting of count copies of the string s.
It panics if count is negative or if the result of (len(s) * count) overflows.
func (String) Replace ¶
Replace returns a copy of the string s with the first n non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string.
func (String) ReplaceN ¶
ReplaceN returns a copy of the string s with the first n non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to If n < 0, there is no limit on the number of replacements.
func (String) RestoreProtected ¶
func (s String) RestoreProtected(array StringArray) String
RestoreProtected restores a string transformed by ProtectString to its original value.
func (String) SelectContext ¶
SelectContext returns the selected word from the specified position.
func (String) SelectWord ¶
SelectWord returns the selected word from the specified position.
func (String) Split ¶
func (s String) Split(sep string) StringArray
Split slices s into all substrings separated by sep and returns a slice of the substrings between those separators.
If s does not contain sep and sep is not empty, Split returns a slice of length 1 whose only element is s.
If sep is empty, Split splits after each UTF-8 sequence. If both s and sep are empty, Split returns an empty slice.
It is equivalent to SplitN with a count of -1.
func (String) SplitAfter ¶
func (s String) SplitAfter(sep string) StringArray
SplitAfter slices s into all substrings after each instance of sep and returns a slice of those substrings.
If s does not contain sep and sep is not empty, SplitAfter returns a slice of length 1 whose only element is s.
If sep is empty, SplitAfter splits after each UTF-8 sequence. If both s and sep are empty, SplitAfter returns an empty slice.
It is equivalent to SplitAfterN with a count of -1.
func (String) SplitAfterN ¶
func (s String) SplitAfterN(sep string, n int) StringArray
SplitAfterN slices s into substrings after each instance of sep and returns a slice of those substrings.
The count determines the number of substrings to return:
n > 0: at most n substrings; the last substring will be the unsplit remainder. n == 0: the result is nil (zero substrings) n < 0: all substrings
Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for SplitAfter.
func (String) SplitN ¶
func (s String) SplitN(sep string, n int) StringArray
SplitN slices s into substrings separated by sep and returns a slice of the substrings between those separators.
The count determines the number of substrings to return:
n > 0: at most n substrings; the last substring will be the unsplit remainder. n == 0: the result is nil (zero substrings) n < 0: all substrings
Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for Split.
func (String) Title ¶
Title returns a copy of the string s with all Unicode letters that begin words mapped to their title case.
BUG(rsc): The rule Title uses for word boundaries does not handle Unicode punctuation properly.
func (String) ToLower ¶
ToLower returns a copy of the string s with all Unicode letters mapped to their lower case.
func (String) ToLowerSpecial ¶
func (s String) ToLowerSpecial(c unicode.SpecialCase) String
ToLowerSpecial returns a copy of the string s with all Unicode letters mapped to their lower case, giving priority to the special casing rules.
func (String) ToTitle ¶
ToTitle returns a copy of the string s with all Unicode letters mapped to their title case.
func (String) ToTitleSpecial ¶
func (s String) ToTitleSpecial(c unicode.SpecialCase) String
ToTitleSpecial returns a copy of the string s with all Unicode letters mapped to their title case, giving priority to the special casing rules.
func (String) ToUpper ¶
ToUpper returns a copy of the string s with all Unicode letters mapped to their upper case.
func (String) ToUpperSpecial ¶
func (s String) ToUpperSpecial(c unicode.SpecialCase) String
ToUpperSpecial returns a copy of the string s with all Unicode letters mapped to their upper case, giving priority to the special casing rules.
func (String) Trim ¶
Trim returns a slice of the string s with all leading and // trailing Unicode code points contained in cutset removed.
func (String) TrimFunc ¶
TrimFunc returns a slice of the string s with all leading and trailing Unicode code points c satisfying f(c) removed.
func (String) TrimLeft ¶
TrimLeft returns a slice of the string s with all leading Unicode code points contained in cutset removed.
func (String) TrimLeftFunc ¶
TrimLeftFunc returns a slice of the string s with all leading Unicode code points c satisfying f(c) removed.
func (String) TrimPrefix ¶
TrimPrefix returns s without the provided leading prefix string. If s doesn't start with prefix, s is returned unchanged.
func (String) TrimRight ¶
TrimRight returns a slice of the string s, with all trailing Unicode code points contained in cutset removed.
func (String) TrimRightFunc ¶
TrimRightFunc returns a slice of the string s with all trailing Unicode code points c satisfying f(c) removed.
func (String) TrimSpace ¶
TrimSpace returns a slice of the string s, with all leading and trailing white space removed, as defined by Unicode.
func (String) TrimSuffix ¶
TrimSuffix returns s without the provided trailing suffix string. If s doesn't end with suffix, s is returned unchanged.
type StringArray ¶
type StringArray []String
StringArray is an implementation of a array of class String objects.
func (StringArray) Center ¶
func (as StringArray) Center(width int) StringArray
Center applies the corresponding String method on each string in the array.
func (StringArray) Indent ¶
func (as StringArray) Indent(indent string) StringArray
Indent applies the corresponding String method on each string in the array.
func (StringArray) IndentN ¶
func (as StringArray) IndentN(indent int) StringArray
IndentN applies the corresponding String method on each string in the array.
func (StringArray) Join ¶
func (as StringArray) Join(sep interface{}) String
Join joins all lines in the array using sep as the join string.
func (StringArray) Sorted ¶
func (as StringArray) Sorted() StringArray
Sorted apply a sort on the array.
func (StringArray) Str ¶
func (as StringArray) Str() []string
Str is just an abbreviation of Strings.
func (StringArray) Strings ¶
func (as StringArray) Strings() []string
Strings convert array of String objects to an array of regular go string.
func (StringArray) Title ¶
func (as StringArray) Title() StringArray
Title applies the corresponding String method on each string in the array.
func (StringArray) ToLower ¶
func (as StringArray) ToLower() StringArray
ToLower applies the corresponding String method on each string in the array.
func (StringArray) ToLowerSpecial ¶
func (as StringArray) ToLowerSpecial(c unicode.SpecialCase) StringArray
ToLowerSpecial applies the corresponding String method on each string in the array.
func (StringArray) ToTitle ¶
func (as StringArray) ToTitle() StringArray
ToTitle applies the corresponding String method on each string in the array.
func (StringArray) ToTitleSpecial ¶
func (as StringArray) ToTitleSpecial(c unicode.SpecialCase) StringArray
ToTitleSpecial applies the corresponding String method on each string in the array.
func (StringArray) ToUpper ¶
func (as StringArray) ToUpper() StringArray
ToUpper applies the corresponding String method on each string in the array.
func (StringArray) ToUpperSpecial ¶
func (as StringArray) ToUpperSpecial(c unicode.SpecialCase) StringArray
ToUpperSpecial applies the corresponding String method on each string in the array.
func (StringArray) Trim ¶
func (as StringArray) Trim(cutset string) StringArray
Trim applies the corresponding String method on each string in the array.
func (StringArray) TrimFunc ¶
func (as StringArray) TrimFunc(f func(rune) bool) StringArray
TrimFunc applies the corresponding String method on each string in the array.
func (StringArray) TrimLeft ¶
func (as StringArray) TrimLeft(cutset string) StringArray
TrimLeft applies the corresponding String method on each string in the array.
func (StringArray) TrimLeftFunc ¶
func (as StringArray) TrimLeftFunc(f func(rune) bool) StringArray
TrimLeftFunc applies the corresponding String method on each string in the array.
func (StringArray) TrimPrefix ¶
func (as StringArray) TrimPrefix(prefix string) StringArray
TrimPrefix applies the corresponding String method on each string in the array.
func (StringArray) TrimRight ¶
func (as StringArray) TrimRight(cutset string) StringArray
TrimRight applies the corresponding String method on each string in the array.
func (StringArray) TrimRightFunc ¶
func (as StringArray) TrimRightFunc(f func(rune) bool) StringArray
TrimRightFunc applies the corresponding String method on each string in the array.
func (StringArray) TrimSpace ¶
func (as StringArray) TrimSpace() StringArray
TrimSpace applies the corresponding String method on each string in the array.
func (StringArray) TrimSuffix ¶
func (as StringArray) TrimSuffix(suffix string) StringArray
TrimSuffix applies the corresponding String method on each string in the array.
func (StringArray) UnIndent ¶
func (as StringArray) UnIndent() StringArray
UnIndent applies the corresponding String method on each string in the array.
func (StringArray) Wrap ¶
func (as StringArray) Wrap(width int) StringArray
Wrap applies the corresponding String method on each string in the array.
Notes ¶
Bugs ¶
The rule Title uses for word boundaries does not handle Unicode punctuation properly.