sortedBy<R extends Comparable> method

  1. @useResult
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

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