str

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Helper functions for handling strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUp added in v0.13.0

func CleanUp(str string) string

func Contains

func Contains(slice []string, s string) bool

Checks if given string exists in the slice.

func ContainsIgnorecase

func ContainsIgnorecase(slice []string, s string) bool

Checks if given string exists in the slice. Case insensitive.

func FindIndex

func FindIndex(slice []string, s string) (int, bool)

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

func Insert(slice []string, idx int, val string) []string

Inserts given string to given index into a slice and returns the result as new slice

func Remove added in v0.2.3

func Remove(slice []string, s string) []string

Removes the first occurence of given string from a slice and returns the result as new slice

func RemoveFrom added in v0.2.3

func RemoveFrom(slice []string, s int) []string

Removes a string from given index and returns the result as new slice

func ToSnakeCase added in v0.2.3

func ToSnakeCase(str string) string

Converts string to SnakeCase.

func Unique

func Unique(t []string) []string

Returns unique strings from given slice of strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL