stringslice

package
v14.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(list []string) string

Connect provides a human-readable serialization of the given strings list.

func JoinArgs

func JoinArgs(args []string) string

JoinArgs provides the given command arguments joined into a single string while quote-escaping as needed.

func Lines

func Lines(text string) []string

func LinesWithPrefix

func LinesWithPrefix(lines []string, prefix string) []string

func Longest

func Longest(strings []string) int

Longest provides the length of the longest string in the given string slice.

func SurroundEmptyWith

func SurroundEmptyWith(strings []string, surround string) []string

SurroundEmptyWith surrounds all empty strings in the given list with the given character.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector accumulates string instances one at a time. The zero value is an empty collection.

func (*Collector) Add

func (self *Collector) Add(text string)

Add appends a string instance to this collector.

func (*Collector) Result

func (self *Collector) Result() []string

Result provides all accumulated string instances.

Jump to

Keyboard shortcuts

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