Add toCap() to capitalize the first letter of a string
This commit is contained in:
parent
9efa2cbe8c
commit
8fd9d71625
|
@ -32,7 +32,7 @@ func (g *generic) Hack() (string, error) {
|
||||||
//fmt.Printf("(%s) definite: %t; hasAdj: %t; plural: %t\n", np, definite, hasAdj, plural)
|
//fmt.Printf("(%s) definite: %t; hasAdj: %t; plural: %t\n", np, definite, hasAdj, plural)
|
||||||
|
|
||||||
sb := strings.Builder{}
|
sb := strings.Builder{}
|
||||||
sb.WriteString(np)
|
sb.WriteString(toCap(np))
|
||||||
|
|
||||||
ctime := models.CM_Present
|
ctime := models.CM_Present
|
||||||
ctype := models.CT_I
|
ctype := models.CT_I
|
||||||
|
@ -256,3 +256,7 @@ func ana(phrase string) string {
|
||||||
|
|
||||||
return "a " + phrase
|
return "a " + phrase
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func toCap(words string) string {
|
||||||
|
return strings.ToUpper(string(words[0])) + words[1:]
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue