text

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayWidth

func DisplayWidth(s string) int

DisplayWidth calculates what the rendered width of string s will be.

func FuzzyAgo

func FuzzyAgo(a, b time.Time) string

func Indent

func Indent(s, indent string) string

Indent returns a copy of the string s with indent prefixed to it, will apply indent to each line of the string.

func Pluralize

func Pluralize(num int, thing string) string

Pluralize returns a concatenated string with num and the plural form of thing if necessary.

func RelativeTimeAgo

func RelativeTimeAgo(a, b time.Time) string

RelativeTimeAgo returns a human readable string of the time duration between a and b that is estimated to the nearest unit of time.

func RemoveDiacritics

func RemoveDiacritics(value string) string

RemoveDiacritics returns the input value without "diacritics", or accent marks

func Truncate

func Truncate(maxWidth int, s string) string

Truncate returns a copy of the string s that has been shortened to fit the maximum display width.

Types

This section is empty.

Jump to

Keyboard shortcuts

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