stringsutil

package module
v0.0.0-...-7619a6f Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 9 Imported by: 0

README

stringsutil

The package contains various helpers to interact with strings

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func After

func After(value string, a string) string

After extracts the string after a from value

func Before

func Before(value string, a string) string

Before extracts the string before a from value

func Between

func Between(value string, a string, b string) string

Between extracts the string between a and b

func ContainsAny

func ContainsAny(s string, ss ...string) bool

ContainsAny returns true is s contains any specified substring

func EqualFoldAny

func EqualFoldAny(s string, ss ...string) bool

EqualFoldsAny returns true is s is equal to any specified substring

func HasPrefixAny

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

HasPrefixAny checks if the string starts with any specified prefix

func HasPrefixI

func HasPrefixI(s, prefix string) bool

HasPrefixI is case insensitive HasPrefix

func HasSuffixAny

func HasSuffixAny(s string, suffixes ...string) bool

// HasSuffixAny checks if the string ends with any specified suffix

func HasSuffixI

func HasSuffixI(s, suffix string) bool

HasSuffixI is case insensitive HasSuffix

func Join

func Join(elems []interface{}, sep string) string

Join concatenates the elements of its first argument to create a single string. The separator string sep is placed between elements in the resulting string.

func RemoveAccent

func RemoveAccent(oldname string) string

Remove all accents of a given string, return clean string.

func Reverse

func Reverse(s string) string

Reverse the string

func TrimPrefixAny

func TrimPrefixAny(s string, prefixes ...string) string

TrimPrefixAny trims all prefixes from string in order

func TrimSuffixAny

func TrimSuffixAny(s string, suffixes ...string) string

TrimPrefixAny trims all suffixes from string in order

func UnicodeToAscii

func UnicodeToAscii(str string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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