MCPcopy Create free account
hub / github.com/gobeam/stringy / KebabCase

Method KebabCase

stringy.go:202–207  ·  view source on GitHub ↗

KebabCase is variadic function that takes one Param slice of strings named rule and it returns passed string in kebab case form. Rule param helps to omit character you want to omit from string. By default special characters like "_", "-","."," " are l\treated like word separator and treated accordin

(rule ...string)

Source from the content-addressed store, hash-verified

200// Example input: hello user
201// Result : hello-user
202func (i *input) KebabCase(rule ...string) StringManipulation {
203 input := getInput(*i)
204 wordArray := caseHelper(input, false, rule...)
205 i.Result = strings.Join(wordArray, "-")
206 return i
207}
208
209// Last returns last n characters from provided input. It removes all spaces in string before doing so.
210func (i *input) Last(length int) string {

Callers

nothing calls this directly

Calls 2

getInputFunction · 0.85
caseHelperFunction · 0.85

Tested by

no test coverage detected