stringy

package
v0.1.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OrDefault

func OrDefault(s string, defaultVal string) string

OrDefault returns s if its length is > 0, and defaultVal otherwise.

func Pointer

func Pointer(v string) *string

Pointer returns a pointer to the given string. NOTE: this method is deprecated. Use helpy.Pointer instead.

func RandomN

func RandomN(length int) string

func StringOrDefault

func StringOrDefault(v *string, defaultVal string) *string

StringOrDefault returns string if it is not nil, and a pointer to defaultVal otherwise. NOTE: this method is deprecated. Use helpy.DerefOrValue instead.

func Unique

func Unique(vs []string) []string

Unique returns a new list containing unique strings from the given input NOTE: this function is deprecated. Use slicey.Unique instead.

Types

type Set

type Set helpy.Set[string]

NOTE: this type is deprecated. Use helpy.Set instead

func MakeSet

func MakeSet(vs ...string) Set

MakeSet returns a lookup map for string NOTE: this function is deprecated. Use helpy.MakeSet instead.

func ToSet

func ToSet(vs []string) Set

ToSet returns a lookup map for string. NOTE: this function is deprecated. Use helpy.ToSet instead.

func (Set) Contains

func (s Set) Contains(v string) bool

func (Set) Equal

func (s Set) Equal(s2 Set) bool

func (Set) Intersect

func (s Set) Intersect(s2 Set) Set

func (Set) Union

func (s Set) Union(s2 Set) Set

Jump to

Keyboard shortcuts

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