Issue 155 - fix StringIndexOutOfBoundException

This commit is contained in:
Sergey Babkin 2017-12-17 18:11:00 +03:00 committed by Amine Bou
parent 0055a503b3
commit 4c499abcdb

View File

@ -8,7 +8,7 @@ import java.util.*
fun String.toTextDrawableString(): String {
val textDrawable = StringBuilder()
for (s in this.split(" ".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()) {
for (s in this.split(" ".toRegex()).filter { !it.isEmpty() }.toTypedArray()) {
textDrawable.append(s[0])
}
return textDrawable.toString()