badger/internal/tools/strings.go

25 lines
441 B
Go
Raw Permalink Normal View History

2023-03-14 09:53:33 +01:00
package tools
// exported function(s)
func IsEmpty(input string) bool {
return len(input) == 0 || input == ""
}
func NotEmpty(input string) bool {
return !IsEmpty(input)
}
func FrontFill(input string, fill string, length int) string {
for len(input) < length {
input = fill + input
}
return input
}
func BackFill(input string, fill string, length int) string {
for len(input) < length {
input = input + fill
}
return input
}