MCPcopy Create free account
hub / github.com/chanced/caps / ToUpper

Function ToUpper

token/token.go:223–235  ·  view source on GitHub ↗

ToLUpper upper cases cases each rune of s using caser and writes to b

(caser Caser, s string)

Source from the content-addressed store, hash-verified

221
222// ToLUpper upper cases cases each rune of s using caser and writes to b
223func ToUpper(caser Caser, s string) string {
224 caser = CaserOrDefault(caser)
225 b := strings.Builder{}
226 b.Grow(len(s))
227 for i, r := range s {
228 if i == 0 {
229 b.WriteRune(caser.ToTitle(r))
230 } else {
231 b.WriteRune(caser.ToUpper(r))
232 }
233 }
234 return b.String()
235}
236
237// IsEmpty reports whether s has a len of 0
238func IsEmpty(s string) bool {

Callers 3

FormatTokenFunction · 0.92
TestToUpperFunction · 0.92
TestTurkishFunction · 0.92

Calls 4

CaserOrDefaultFunction · 0.85
ToTitleMethod · 0.65
ToUpperMethod · 0.65
StringMethod · 0.45

Tested by 2

TestToUpperFunction · 0.74
TestTurkishFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…