Documentation
¶
Overview ¶
Helper functions for handling strings.
Index ¶
- func CleanUp(str string) string
- func Contains(slice []string, s string) bool
- func ContainsIgnorecase(slice []string, s string) bool
- func FindIndex(slice []string, s string) (int, bool)
- func Insert(slice []string, idx int, val string) []string
- func InsertInplaec(slice []string, idx int, val string)
- func Remove(slice []string, s string) []string
- func RemoveFrom(slice []string, s int) []string
- func RemoveFromInplace(slice []string, s int)
- func RemoveInplace(slice []string, s string)
- func ToSnakeCase(str string) string
- func Unique(t []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsIgnorecase ¶
Checks if given string exists in the slice. Case insensitive.
func FindIndex ¶
Finds the index of first occurrence of the given value and returns the index and a boolean. Boolean is true when index is found, otherwise index = -1.
func Insert ¶ added in v0.2.3
Inserts given string to given index into a slice and returns the result as new slice
func InsertInplaec ¶ added in v0.20.0
Inserts given string to given index in place
func Remove ¶ added in v0.2.3
Removes the first occurence of given string from a slice and returns the result as new slice
func RemoveFrom ¶ added in v0.2.3
Removes a string from given index and returns the result as new slice
func RemoveFromInplace ¶ added in v0.20.0
Removes a string from given index in place
func RemoveInplace ¶ added in v0.20.0
Removes the first occurence of given string in place
func ToSnakeCase ¶ added in v0.2.3
Converts string to SnakeCase.
Types ¶
This section is empty.