utils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package utils provides various utility functions for string manipulation, color conversion, and slice operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsDigits added in v0.4.6

func ContainsDigits(s string) bool

ContainsDigits checks if a string contains any digit characters.

func HSVToRGB added in v0.3.2

func HSVToRGB(h, s, v float64) (int32, int32, int32)

HSVToRGB converts HSV color values to RGB color values.

func IntersectionSlices added in v0.4.9

func IntersectionSlices[T constraints.Ordered](a, b []T) []T

IntersectionSlices returns the intersection of two slices.

func MostOcc added in v0.4.6

func MostOcc[T comparable](items []T) T

MostOcc returns the most occurring element in a slice of comparable elements.

func OnlyContainsDigits added in v0.4.6

func OnlyContainsDigits(s string) bool

OnlyContainsDigits checks if a string contains only digit characters.

func RandomString added in v0.5.34

func RandomString(base string) (string, error)

RandomString generates a random string prepended with a base string.

func ReverseSlice added in v0.4.9

func ReverseSlice[T any](s []T)

ReverseSlice reverses a slice in place.

func ShortenString added in v0.2.11

func ShortenString(s string, l int) string

ShortenString shortens a string to a given length and appends "..." if it exceeds that length.

func SliceEquals added in v0.4.9

func SliceEquals[T constraints.Ordered](a, b []T) bool

SliceEquals checks if two slices are equal, ignoring order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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