sortedBy<R extends Comparable> method

KtList<T> sortedBy<R extends Comparable>(
  1. R selector(
    1. T
    )
)

Returns a list of all elements sorted according to natural sort order of the value returned by specified selector function.

Implementation

KtList<T> sortedBy<R extends Comparable>(R Function(T) selector) {
  return sortedWith(compareBy(selector));
}