sforkowany z mirror/meshtastic-android
Always keep first character of long name when making short name from one word long names
rodzic
2dab8ccf19
commit
bd18a3aadd
|
@ -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("")
|
||||
|
|
Ładowanie…
Reference in New Issue