How can I convert
List(1, 2, "3")
to
List(1, 2, 3)
since List(1, 2, "3")
is of type List[Any]
and I can't use .toInt
on Any
.
That should be sufficient solution:
l.map(_.toString.toInt)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments