Skip to content

Instantly share code, notes, and snippets.

@yukari-n
Created April 11, 2019 09:45
Show Gist options
  • Select an option

  • Save yukari-n/c7d7c1cc85bc75918821ce243af04997 to your computer and use it in GitHub Desktop.

Select an option

Save yukari-n/c7d7c1cc85bc75918821ce243af04997 to your computer and use it in GitHub Desktop.
Scalaでsort
val row1 = (11,"asdf","hoge")
val row2 = (2,"basdf","hoge")
val csv = Seq(row1,row2)
csv.sortBy(_._1)
// res0: Seq[(Int, String, String)] = List((2,basdf,hoge), (11,asdf,hoge))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment