First commit

This commit is contained in:
Jae Kwon
2015-10-21 12:15:19 -07:00
commit 16372365c4
21 changed files with 1850 additions and 0 deletions

24
string.go Normal file
View 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
}