generic

package
v2.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package generic provides generic string utility functions that work with any type that has string as its underlying type (using the ~string constraint). This allows these functions to work with custom string types while maintaining type safety.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmpty

func IsEmpty[T ~string](s T) bool

IsEmpty tests if the string is empty

func IsNonEmpty

func IsNonEmpty[T ~string](s T) bool

IsNonEmpty tests if the string is not empty

func Size

func Size[T ~string](s T) int

Size returns the size of the string

func ToBytes

func ToBytes[T ~string](s T) []byte

ToBytes converts the string to bytes

func ToRunes

func ToRunes[T ~string](s T) []rune

ToRunes converts the string to runes

Types

This section is empty.

Jump to

Keyboard shortcuts

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