helper

package
v0.0.0-...-5ce111e Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

)

THe app logo

Variables

This section is empty.

Functions

func AddOrdinals

func AddOrdinals(s string) string

AddOrdinals add ordinal indicators like 1 -> 1st 2 -> 2nd and so on

func ChangeDigitLanguage

func ChangeDigitLanguage(str *string, lang string)

ChangeDigitLanguage changes the language of any numeric chars in the string

func GetList

func GetList(str, seperator string) ([]string, bool)

GetList takes a string & returns a slice separated by the separator provided & true/false based on the length of the slice

func GetStrIfTrue

func GetStrIfTrue(s string, l bool) string

GetStrIfTrue returns the given string if the provided bool is true

func IndexOf

func IndexOf(ss []string, e string) int

IndexOf returns the index of the first occurence of the element matched in the string slice

func IsDigit

func IsDigit(s string) bool

IsDigit determines whether the given string is a digit or not

func PrettyTime

func PrettyTime(h string, m string) (string, error)

PrettyTime takes hour and minute and returns then with a proper time layout

func RunPrompt

func RunPrompt(label string, items []string) (string, error)

RunPrompt executes a prompt to chose an item from the cli

func TrimExtraSpaces

func TrimExtraSpaces(s string) string

TrimExtraSpaces Trims any extra space (should be one space gaps)

func Unique

func Unique(ss []string) []string

Unique takes a string slice a removes the duplicate elements

Types

This section is empty.

Jump to

Keyboard shortcuts

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