add

package
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: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Brackets

func Brackets(
	contentSeparator *gostringsseparator.Content,
	content string,
) string

Brackets adds square brackets around the content string, optionally using a separator.

Parameters:

contentSeparator - pointer to a Content struct for separators (can be nil)
content          - the string to wrap in brackets

Returns:

The resulting string wrapped in square brackets.

func Characters

func Characters(
	contentSeparator *gostringsseparator.Content,
	content, leftCharacters, rightCharacters string,
) string

Characters adds left and right characters to the content string, optionally using a separator.

Parameters:

contentSeparator - pointer to a Content struct for separators (can be nil)
content          - the main string to wrap
leftCharacters   - characters to add to the left of the content
rightCharacters  - characters to add to the right of the content

Returns:

The resulting string with added characters and optional separators.

func CurlyBrackets

func CurlyBrackets(
	contentSeparator *gostringsseparator.Content,
	content string,
) string

CurlyBrackets adds curly brackets around the content string, optionally using a separator.

Parameters:

contentSeparator - pointer to a Content struct for separators (can be nil)
content          - the string to wrap in curly brackets

Returns:

The resulting string wrapped in curly brackets.

func Parentheses

func Parentheses(
	contentSeparator *gostringsseparator.Content,
	content string,
) string

Parentheses adds parentheses around the content string, optionally using a separator.

Parameters:

contentSeparator - pointer to a Content struct for separators (can be nil)
content          - the string to wrap in parentheses

Returns:

The resulting string wrapped in parentheses.

func Prefixes added in v0.1.5

func Prefixes(
	content string,
	separator gostringsseparator.Separator,
	prefixes ...string,
) string

Prefixes returns a string by joining the given prefixes and content using the specified separator.

Parameters:

content   - the main string to append after the prefixes
separator - the separator to use between elements
prefixes  - variadic list of prefix strings to prepend to the content

Returns:

A single string with all prefixes and the content joined by the separator.

Types

type CharactersFn

type CharactersFn func(
	contentSeparator *gostringsseparator.Content,
	content string,
) string

CharactersFn is a function type that adds characters to a string.

Parameters:

contentSeparator - pointer to a Content struct for separators
content          - the string to which characters will be added

Returns:

The resulting string after adding characters.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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