mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-29 04:31:44 +00:00
First commit
This commit is contained in:
24
string.go
Normal file
24
string.go
Normal file
@ -0,0 +1,24 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var Fmt = fmt.Sprintf
|
||||
|
||||
func RightPadString(s string, totalLength int) string {
|
||||
remaining := totalLength - len(s)
|
||||
if remaining > 0 {
|
||||
s = s + strings.Repeat(" ", remaining)
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func LeftPadString(s string, totalLength int) string {
|
||||
remaining := totalLength - len(s)
|
||||
if remaining > 0 {
|
||||
s = strings.Repeat(" ", remaining) + s
|
||||
}
|
||||
return s
|
||||
}
|
Reference in New Issue
Block a user