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

Method PascalCase

stringy.go:143–152  ·  view source on GitHub ↗

PascalCase is variadic function which takes one Param rule i.e slice of strings and it returns input type string in camel case form and rule helps to omit character you want to omit from string. By default special characters like "_", "-","."," " are l\treated like word separator and treated accordi

(rule ...string)

Source from the content-addressed store, hash-verified

141// Example input: hello user
142// Result : HelloUser
143func (i *input) PascalCase(rule ...string) StringManipulation {
144 input := getInput(*i)
145 // removing excess space
146 wordArray := caseHelper(input, true, rule...)
147 for i, word := range wordArray {
148 wordArray[i] = ucfirst(word)
149 }
150 i.Result = strings.Join(wordArray, "")
151 return i
152}
153
154// ContainsAll is variadic function which takes slice of strings as param and checks if they are present
155// in input and returns boolean value accordingly

Callers

nothing calls this directly

Calls 3

getInputFunction · 0.85
caseHelperFunction · 0.85
ucfirstFunction · 0.85

Tested by

no test coverage detected