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

Method Delimited

stringy.go:170–178  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
170func (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.
181func (i *input) First(length int) string {

Callers

nothing calls this directly

Calls 2

getInputFunction · 0.85
caseHelperFunction · 0.85

Tested by

no test coverage detected