strings

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InSlice added in v0.11.0

func InSlice(s string, sl []string) bool

InSlice returns true if the string is in the slice.

func IsASCIIIdentifier

func IsASCIIIdentifier(s string) bool

IsASCIIIdentifier takes a string and returns true if the string does not contain any special characters.

func LowerRand

func LowerRand(n int) string

LowerRand generates a random string of lower case letters n characters long.

func NormalizeURL

func NormalizeURL(s string) (string, error)

NormalizeURL uses purell's "usually safe normalization" algorithm to normalize URLs. This includes removing dot segments, removing trailing slashes, removing unnecessary escapes, removing default ports, and setting the URL to lowercase.

func Ptr added in v0.11.0

func Ptr(s string) *string

Ptr returns a pointer to a string.

func QuoteNonASCII

func QuoteNonASCII(s string) string

QuoteNonASCII puts quotes around an identifier that contains non-ASCII characters.

func Rand

func Rand(n int) string

Rand generates a random string of lower and upper case letters n characters long.

Types

This section is empty.

Jump to

Keyboard shortcuts

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