strconvx

package
v0.0.0-...-d3b5644 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBool

func FormatBool[Bool ~bool](b Bool) string

FormatBool takes a boolean-type generic parameter `b`, converts it to a string, and returns the string.

func FormatBoolSlice

func FormatBoolSlice[Bool ~bool](s []Bool) []string

func FormatFloat

func FormatFloat[Float constraints.Float](f Float, fmt byte, prec, bitSize int) string

func FormatFloatSlice

func FormatFloatSlice[Float constraints.Float](s []Float, fmt byte, prec, bitSize int) []string

func FormatInt

func FormatInt[Signed constraints.Signed](i Signed, base int) string

func FormatIntSlice

func FormatIntSlice[Signed constraints.Signed](s []Signed, base int) []string

func FormatUint

func FormatUint[Unsigned constraints.Unsigned](i Unsigned, base int) string

FormatUint converts an unsigned integer to a string representation in a specified base. It does this by first converting the integer to a uint64 and then using the strconv.FormatUint function to format it as a string in the desired base.

func FormatUintSlice

func FormatUintSlice[Unsigned constraints.Unsigned](s []Unsigned, base int) []string

func ParseBool

func ParseBool(s string) (bool, error)

func ParseBoolSlice

func ParseBoolSlice(s []string) ([]bool, error)

func ParseBytesSlice

func ParseBytesSlice(s []string) [][]byte

func ParseFloat

func ParseFloat[Float constraints.Float](s string, bitSize int) (Float, error)

func ParseFloatSlice

func ParseFloatSlice[Float constraints.Float](s []string, bitSize int) ([]Float, error)

func ParseInt

func ParseInt[Signed constraints.Signed](s string, base int, bitSize int) (Signed, error)

func ParseIntSlice

func ParseIntSlice[Signed constraints.Signed](s []string, base int, bitSize int) ([]Signed, error)

func ParseUint

func ParseUint[Unsigned constraints.Unsigned](s string, base int, bitSize int) (Unsigned, error)

func ParseUintSlice

func ParseUintSlice[Unsigned constraints.Unsigned](s []string, base int, bitSize int) ([]Unsigned, error)

func Quote

func Quote[E ~string](e E, quote string) E

Quote quotes the string.

func QuoteSlice

func QuoteSlice[S ~[]E, E ~string](s S, quote string) S

QuoteSlice quotes each string in the slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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