Randhir Singh walks us through several methods of sorting in Scala:
sortBy(attribute)
Here is signature
def sortBy[B](f: A => B)(implicit ord: Ordering[B]): Repr
The
sortBy
function is used to sort one or moreattributes.
Here is a small example.
sort based on a single attribute of the case class.
Click through for several examples.