25 lines
441 B
Go
25 lines
441 B
Go
|
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
|
||
|
}
|