CamelCase 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 accordin
(rule ...string)
| 120 | // Example input: hello user |
| 121 | // Result : helloUser |
| 122 | func (i *input) CamelCase(rule ...string) StringManipulation { |
| 123 | input := getInput(*i) |
| 124 | // removing excess space |
| 125 | wordArray := caseHelper(input, true, rule...) |
| 126 | for i, word := range wordArray { |
| 127 | if i == 0 { |
| 128 | wordArray[i] = strings.ToLower(word) |
| 129 | } else { |
| 130 | wordArray[i] = ucfirst(word) |
| 131 | } |
| 132 | } |
| 133 | i.Result = strings.Join(wordArray, "") |
| 134 | return i |
| 135 | } |
| 136 | |
| 137 | // PascalCase is variadic function which takes one Param rule i.e slice of strings and it returns |
| 138 | // input type string in camel case form and rule helps to omit character you want to omit from string. |
nothing calls this directly
no test coverage detected