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 Remove(slice []string, s string) []string
- func RemoveFrom(slice []string, s int) []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 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 ToSnakeCase ¶ added in v0.2.3
Converts string to SnakeCase.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.