Skip to content

App Gets Crashed when textInitials Contains Multiple spaces in between. For eg :- "Test Name" #46

@mdhanif-simformsolutions

Description

Hi,
Thanks for this amazing library, I found one issue here :-
When we set textInitials which contains multiple spaces in between at that time app is crashed :-
Eg :- When I try to set textInitials = Test Name

So main issue is here :-
/** Returns parsed initials from a String. */ internal val String.parseInitials: String @JvmSynthetic inline get() { val textList = trim().split(" ") return when { textList.size > 1 -> "${textList[0][0]}${textList[1][0]}" textList[0].length > 1 -> "${textList[0][0]}${textList[0][1]}" textList[0].isNotEmpty() -> "${textList[0][0]}" else -> "" }.uppercase() }

Now now when `Test     Name` is split it gives [Test, , ,Name] here second and third space is empty

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions