In the Scala repl if I evaluate :
val lines : String = ("a1 , test1 , test2 , a2 , test3 , test4")
lines.split(",").grouped(3).toList
I receive this on save :
//> res0: List[Array[String]] = List(Array("a1 ", " test1 ", " test2 "), Array("
//| a2 ", " test3 ", " test4"))
I would like to be able to print this information to the console, the value of res0
So something like printTypeInformation(lines.split(",").grouped(3).toList)
will print same value as res0 above. I think I could achieve this for above type by iterating over the List printing the values and type information. But is there a more generic method so that this information can be printed for any type ?