text

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(s string) bool

Empty tell if the string is considered empty once space and not graphics characters are removed

func LeftPad

func LeftPad(text string, leftPad int) string

LeftPad left pad each line of the given text

func LeftPadMaxLine

func LeftPadMaxLine(value string, maxValueLength, leftPad int) string

LeftPadMaxLine pads a string on the left by a specified amount and pads the string on the right to fill the maxLength

func Safe

func Safe(s string) bool

Safe will tell if a character in the string is considered unsafe Currently trigger on unicode control character except \n, \t and \r

func ValidUrl

func ValidUrl(s string) bool

ValidUrl will tell if the string contains what seems to be a valid URL

func Wrap

func Wrap(text string, lineWidth int) (string, int)

Wrap a text for an exact line size Handle properly terminal color escape code

func WrapLeftPadded

func WrapLeftPadded(text string, lineWidth int, leftPad int) (string, int)

Wrap a text for an exact line size with a left padding Handle properly terminal color escape code

Types

This section is empty.

Jump to

Keyboard shortcuts

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