For Tuple2 you can use:
val list = List(("1", 4), ("dfg", 67)) list.map { case (str, int) => s"$str $int"}
For any tuples, try this code:
val list = List[Product](("dfsgd", 234), ("345345", 345, 456456)) list.map { tuple => tuple.productIterator.mkString("\t") }
Sergey Lagutin
source share