Capitalize

Capitalizes the first letter of a string.

  • Use strings.ToUpper() to capitalize the first letter of the string.
import "strings"

func Capitalize(s string) string {
    return strings.ToUpper(s[0:1]) + s[1:]
}
Capitalize("boomerang") // "Boomerang"