MCPcopy Create free account
hub / github.com/gogs/gogs / ToUpperFirst

Function ToUpperFirst

internal/strutil/strutil.go:10–15  ·  view source on GitHub ↗

ToUpperFirst returns s with only the first Unicode letter mapped to its upper case.

(s string)

Source from the content-addressed store, hash-verified

8
9// ToUpperFirst returns s with only the first Unicode letter mapped to its upper case.
10func ToUpperFirst(s string) string {
11 for i, v := range s {
12 return string(unicode.ToUpper(v)) + s[i+1:]
13 }
14 return ""
15}
16
17// RandomChars returns a generated string in given number of random characters.
18func RandomChars(n int) (string, error) {

Callers 3

serveVerifyMethod · 0.92
serveBatchFunction · 0.92
TestToUpperFirstFunction · 0.85

Calls 1

stringFunction · 0.85

Tested by 1

TestToUpperFirstFunction · 0.68