uiprogress: github.com/gosuri/uiprogress/util/strutil Index | Files

package strutil

import "github.com/gosuri/uiprogress/util/strutil"

Package strutil provides various utilities for manipulating strings

Index

Package Files

strutil.go

func PadLeft Uses

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 Uses

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 PrettyTime Uses

func PrettyTime(t time.Duration) string

PrettyTime returns the string representation of the duration. It rounds the time duration to a second and returns a "---" when duration is 0

func Resize Uses

func Resize(s string, length uint) string

Resize 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

Package strutil imports 2 packages (graph) and is imported by 14 packages. Updated 2016-07-19. Refresh now. Tools for package owners.