MCPcopy
hub / github.com/jesseduffield/lazygit / snakeToPascal

Function snakeToPascal

pkg/integration/tests/test_list_generator.go:102–116  ·  view source on GitHub ↗

thanks ChatGPT

(s string)

Source from the content-addressed store, hash-verified

100
101// thanks ChatGPT
102func snakeToPascal(s string) string {
103 // Split the input string into words.
104 words := strings.Split(s, "_")
105
106 // Convert the first letter of each word to uppercase and concatenate them.
107 var builder strings.Builder
108 for _, w := range words {
109 if len(w) > 0 {
110 builder.WriteString(strings.ToUpper(w[:1]))
111 builder.WriteString(w[1:])
112 }
113 }
114
115 return builder.String()
116}

Callers 1

appendDirTestsFunction · 0.85

Calls 2

WriteStringMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected