PHP » GoLang |
login |
register |
about
|
str_padstr_pad[code=golang] func StrPadLeft(input string, padLength int, padString string) string { output := padString for padLength > len(output) { output += output } if len(input) >= padLength { return input } return output[:padLength-len(input)] + input } [/code] |