MCPcopy Create free account
hub / github.com/ankorstore/yokai / Sanitize

Function Sanitize

fxhttpserver/util.go:17–22  ·  view source on GitHub ↗

Sanitize transforms a given string to not contain spaces or dashes, and to be in lower case.

(str string)

Source from the content-addressed store, hash-verified

15
16// Sanitize transforms a given string to not contain spaces or dashes, and to be in lower case.
17func Sanitize(str string) string {
18 san := strings.ReplaceAll(str, " ", "_")
19 san = strings.ReplaceAll(san, "-", "_")
20
21 return strings.ToLower(san)
22}
23
24// Split trims and splits a provided string by comma.
25func Split(str string) []string {

Callers 1

withDefaultMiddlewaresFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected