<Why is Kotlin not sorting the first element of my...
# stackoverflow
u
Why is Kotlin not sorting the first element of my array? Maybe I'm missing something here, but it seems like sort isn't sorting the array completely. This is what I tried: $ kotlinc Welcome to Kotlin version 1.2.71 (JRE 10.0.2+13-Ubuntu-1ubuntu0.18.04.2) Type :help for help, :quit for quit
>> var test: String = "This is a test of the user system."
>> var testarray2: Array = test.split(" ").toTypedArray()
>> testarray2.sort()
>> testarray2.forEach { println("${it} ") }
This a is of system. test the user
>>
As you can see, sorting...