text

package
Version: v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(list []string, delim string) string

Join joins the list of the string with the delim provided. Returns an empty string for empty list

func PadLeft

func PadLeft(str string, length int, pad byte) string

PadLeft returns a new string of a specified length in which the beginning of the current string is padded with spaces or with a specified Unicode character.

func PadRight

func PadRight(str string, length int, pad byte) string

PadRight returns a new string of a specified length in which the end of the current string is padded with spaces or with a specified Unicode character.

func RuneWidth

func RuneWidth(s rune) int

RuneWidth returns the actual width of the rune

func StringWidth

func StringWidth(s string) int

StringWidth returns the actual width of the string without colors

func Strip

func Strip(s string) string

Strip strips the string of all colors

func Truncate

func Truncate(s string, length int) string

Truncate resizes the string with the given length. It ellipses with '...' when the string's length exceeds the desired length or pads spaces to the right of the string when length is smaller than desired

func WrapString

func WrapString(text string, lineWidth int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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