scala常用操作-Tuple元祖转换成String字符串

版权声明:本文为博主原创文章,转载联系 [email protected] https://blog.csdn.net/qq_31573519/article/details/82793996

不BB直接上代码:

object Test {
  def main(args: Array[String]): Unit = {
    val a = ("a", 1, 9.9)
    var rs = ""
    a.productIterator.foreach(v=> rs = rs + v.toString+"\t")
    println(rs)
  }
}

RS:
a	1	9.9

猜你喜欢

转载自blog.csdn.net/qq_31573519/article/details/82793996
今日推荐