mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-13 03:59:23 +02:00
Automatically camel-case destination
This commit is contained in:
20
tools/utils/strings.go
Normal file
20
tools/utils/strings.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// License: GPLv3 Copyright: 2022, Kovid Goyal, <kovid at kovidgoyal.net>
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
var _ = fmt.Print
|
||||
|
||||
func Capitalize(x string) string {
|
||||
if x == "" {
|
||||
return x
|
||||
}
|
||||
s, sz := utf8.DecodeRuneInString(x)
|
||||
cr := strings.ToUpper(string(s))
|
||||
return cr + x[sz:]
|
||||
}
|
||||
Reference in New Issue
Block a user