Help us shape the future of Go! Take the 2026 Go Developer Survey

string

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ToUpperCase converts the string to uppercase
	ToUpperCase = strings.ToUpper

	// ToLowerCase converts the string to lowercase
	ToLowerCase = strings.ToLower

	// Ord implements the default ordering for strings
	Ord = ord.FromStrictCompare[string]()

	// Join joins strings
	Join = F.Curry2(F.Bind2nd[[]string, string, string])(strings.Join)

	// Equals returns a predicate that tests if a string is equal
	Equals = F.Curry2(Eq)

	// Includes returns a predicate that tests for the existence of the search string
	Includes = F.Bind2of2(strings.Contains)

	// HasPrefix returns a predicate that checks if the prefis is included in the string
	HasPrefix = F.Bind2of2(strings.HasPrefix)
)
View Source
var Monoid = M.MakeMonoid(concat, "")

Monoid is the monoid implementing string concatenation

View Source
var Semigroup = S.MakeSemigroup(concat)

Functions

func Eq

func Eq(left, right string) bool

func Format

func Format[T any](format string) func(T) string

Format applies a format string to an arbitrary value

func Intersperse

func Intersperse(middle string) func(string, string) string

func IntersperseMonoid

func IntersperseMonoid(middle string) M.Monoid[string]

func IntersperseSemigroup

func IntersperseSemigroup(middle string) S.Semigroup[string]

func IsEmpty

func IsEmpty(s string) bool

func IsNonEmpty

func IsNonEmpty(s string) bool

func Size

func Size(s string) int

func ToBytes

func ToBytes(s string) []byte

func ToRunes

func ToRunes(s string) []rune

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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