stringutil

package
v0.1.4-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyFunc

func AnyFunc(s string, strs []string, f func(s, substr string) bool) bool

AnyFunc checks if the `s` string is in any of the `strs` slices that satisfy the given `f` func

func Empty

func Empty(s *string) bool

Empty returns true if the string is empty or nil.

func EqualsIAny

func EqualsIAny(s string, strs ...string) bool

EqualsIAny checks if the string `s` is equal to any of the strings `strs`. Case insensitive and trims the strings.

func HasAnyPrefix

func HasAnyPrefix(s string, prefixes ...string) bool

HasAnyPrefix checks if any of the given `prefixes` are in the `s` string.

func HasAnyiPrefix

func HasAnyiPrefix(s string, prefixes ...string) bool

HasAnyiPrefix checks if any of the given `prefixes` are in the `s` string. Case insensitive.

func MustAtoi

func MustAtoi(s string) int

MustAtoi converts an `s` string using `strconv.Atoi` but panics if there's an error.

func RandString

func RandString(n int) string

RandString generates a random string of the length `n` with characters A-Z, a-z, and 0-9.

Types

This section is empty.

Jump to

Keyboard shortcuts

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