Always keep first character of long name when making short name from one word long names

1.2-legacy
Gunter Tim 2020-09-26 22:21:39 -07:00
rodzic 2dab8ccf19
commit bd18a3aadd
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -28,7 +28,7 @@ fun getInitials(nameIn: String): String {
val initials = when (words.size) {
in 0..minchars - 1 -> {
val nm = name.filterNot { c -> c.toLowerCase() in "aeiou" }
val nm = name.first() + name.drop(1).filterNot { c -> c.toLowerCase() in "aeiou" }
if (nm.length >= nchars) nm else name
}
else -> words.map { it.first() }.joinToString("")