Delimited is variadic function that takes two params delimiter and slice of strings i.e rule. It joins the string by passed delimeter. 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 ac
(delimiter string, rule ...string)
| 168 | // default special characters like "_", "-","."," " are l\treated like word separator and treated accordingly |
| 169 | // by default and you dont have to worry about it. |
| 170 | func (i *input) Delimited(delimiter string, rule ...string) StringManipulation { |
| 171 | input := getInput(*i) |
| 172 | if strings.TrimSpace(delimiter) == "" { |
| 173 | delimiter = "." |
| 174 | } |
| 175 | wordArray := caseHelper(input, false, rule...) |
| 176 | i.Result = strings.Join(wordArray, delimiter) |
| 177 | return i |
| 178 | } |
| 179 | |
| 180 | // First returns first n characters from provided input. It removes all spaces in string before doing so. |
| 181 | func (i *input) First(length int) string { |
nothing calls this directly
no test coverage detected