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

Method Title

stringy.go:364–371  ·  view source on GitHub ↗

Title makes first letter of each word of user input to uppercase it can be chained on function which return StringManipulation interface

()

Source from the content-addressed store, hash-verified

362// Title makes first letter of each word of user input to uppercase
363// it can be chained on function which return StringManipulation interface
364func (i *input) Title() (result string) {
365 input := getInput(*i)
366 wordArray := strings.Split(input, " ")
367 for i, word := range wordArray {
368 wordArray[i] = strings.ToUpper(string(word[0])) + strings.ToLower(word[1:])
369 }
370 return strings.Join(wordArray, " ")
371}
372
373// ToUpper makes all string of user input to uppercase
374// it can be chained on function which return StringManipulation interface

Callers

nothing calls this directly

Calls 3

getInputFunction · 0.85
ToUpperMethod · 0.65
ToLowerMethod · 0.65

Tested by

no test coverage detected