How to get the last item of an ArrayList in kotlin?
I have a list like
val myList = listOf("item1", "item2", "item3")
I want to get the last item of myList
There's last()
method, created exactly for this purpose.
myList.last()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With