1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00

Ensure initials calculate correctly for Unicode via runes

This commit is contained in:
Harvey Kandola 2018-05-02 14:50:22 +01:00
parent b839a0753c
commit e234471b1e
2 changed files with 4 additions and 2 deletions

View file

@ -23,11 +23,11 @@ func MakeInitials(firstname, lastname string) string {
b := ""
if len(firstname) > 0 {
a = firstname[:1]
a = string([]rune(firstname)[:1])
}
if len(lastname) > 0 {
b = lastname[:1]
b = string([]rune(lastname)[:1])
}
return strings.ToUpper(a + b)