Created
February 24, 2016 01:34
-
-
Save hugolu/55c1e16df4a0972a1c1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val list = List(1, 2, 3) //> list : List[Int] = List(1, 2, 3) | |
list.map(_.toString).mkString(", ") //> res0: String = 1, 2, 3 | |
val map = Map(1 -> "A", 2 -> "B", 3 -> "C") //> map : scala.collection.immutable.Map[Int,String] = Map(1 -> A, 2 -> B, 3 -> C) | |
map.map(_ match { case (k, v) => k + ":" + v }).mkString(", ") | |
//> res1: String = 1:A, 2:B, 3:C |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment