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

Method Acronym

stringy.go:61–70  ·  view source on GitHub ↗

Acronym func returns acronym of input string. You can chain to upper which with make result all upercase or ToLower which will make result all lower case or Get which will return result as it is

()

Source from the content-addressed store, hash-verified

59// You can chain to upper which with make result all upercase or ToLower
60// which will make result all lower case or Get which will return result as it is
61func (i *input) Acronym() StringManipulation {
62 input := getInput(*i)
63 words := strings.Fields(input)
64 var acronym string
65 for _, word := range words {
66 acronym += string(word[0])
67 }
68 i.Result = acronym
69 return i
70}
71
72// Between takes two string params start and end which and returns
73// value which is in middle of start and end part of input. You can

Callers

nothing calls this directly

Calls 1

getInputFunction · 0.85

Tested by

no test coverage detected