gostrings

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// AlphanumericCharset is the character set used to generate random UTF-8 safe strings
	AlphanumericCharset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
)

Variables

View Source
var (
	ErrNilStructField = errors.New("struct field is nil")
)

Functions

func Repeat

func Repeat(s string, n int, separator gostringsseparator.Separator) string

Repeat returns a new string consisting of the input string `s` repeated `n` times, separated by the specified separator.

Parameters:

s         - the string to repeat
n         - the number of times to repeat the string
separator - the separator to insert between repetitions

Returns:

A single string with `s` repeated `n` times, separated by `separator`.

func RepeatAsArray

func RepeatAsArray(s string, n int) []string

RepeatAsArray returns a pointer to a slice containing the input string `s` repeated `n` times.

Parameters:

s - the string to repeat
n - the number of times to repeat the string

Returns:

A slice of strings, each element being `s`.

func ToCamelCase added in v0.1.16

func ToCamelCase(s string) string

ToCamelCase converts a string to CamelCase.

Parameters:

  • s: The string to convert.

Returns:

  • string: The converted string.

func ToSnakeCase added in v0.1.16

func ToSnakeCase(s string) string

ToSnakeCase converts a string to snake_case.

Parameters:

  • s: The string to convert.

Returns:

  • string: The converted string.

Types

This section is empty.

Directories

Path Synopsis
add

Jump to

Keyboard shortcuts

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