mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
14 lines
251 B
Go
14 lines
251 B
Go
package helpers
|
|
|
|
import "unicode"
|
|
|
|
// Capitalize turns the first letter of a string to its upper case version.
|
|
func Capitalize(str string) string {
|
|
if len(str) == 0 {
|
|
return ""
|
|
}
|
|
r := []rune(str)
|
|
r[0] = unicode.ToUpper(r[0])
|
|
return string(r)
|
|
}
|