In this tutorial, I will show you how to convert String to Int, Long, Float, Double in Kotlin/Android.
Tag: kotlin
Kotlin List sort, sorted, sortBy, sortedBy, sortWith, sortedWith example
In this tutorial, I will show you many ways to sort Kotlin List using sort
, sorted
, sortBy
, sortedBy
, sortWith
, sortedWith
methods.
Related Posts:
– Kotlin List & Mutable List tutorial with examples
– Kotlin – Sort List of custom Objects
Kotlin – Sort List of custom Objects
In this tutorial, I will show you several useful ways to sort List of custom Objects for Ascending and Descending order in Kotlin. You’re gonna know how to:
- sort List of Objects by one field or multiple fields
- use your custom
Comparator
to sort List of Objects - implement
Comparable
interface to make sorting List of Objects more convenient
Related Posts:
– Kotlin List & Mutable List tutorial with examples
– Kotlin – Compare Objects with Comparable Example
Kotlin sum(), sumBy(), sumByDouble() and BigDecimal in List, Map example
In this Kotlin tutorial, I will show you some examples that uses sum()
, sumBy()
, sumByDouble()
for List, Map. We’re gonna create sum()
& sumByBigDecimal()
which also work for List of BigDecimal
objects.
Related Posts:
– Kotlin List & Mutable List tutorial with examples
– How to work with Kotlin HashMap
– Kotlin Fold Example: fold(), foldRight(), foldIndexed(), foldRightIndexed()
– Kotlin groupBy(), groupingBy() example
Kotlin groupBy, groupByTo, groupingBy example
Kotlin library provides extension functions for grouping collection items. In this tutorial, I will show you some examples to use Kotlin groupBy()
, groupByTo()
, groupingBy()
methods.
Related Posts:
– Kotlin sum(), sumBy(), sumByDouble() and BigDecimal in List, Map example
– Kotlin Fold Example: fold(), foldRight(), foldIndexed(), foldRightIndexed()