ripple-api/common/utils.go
2016-10-16 18:27:12 +02:00

12 lines
222 B
Go

package common
import (
"strings"
)
// SafeUsername makes a string lowercase and replaces all spaces with
// underscores.
func SafeUsername(s string) string {
return strings.Replace(strings.ToLower(s), " ", "_", -1)
}