Answers for "how to get the nth element in a list in scala"

3

how to get the nth element in a list in scala

val x = List(1,2,3,4,5)
println(x(3))	// output: 4
Posted by: Guest on December-21-2020
1

scala get the first element of a seq

Seq("1", "two", "3").head
Posted by: Guest on September-23-2020

Code answers related to "how to get the nth element in a list in scala"

Code answers related to "Scala"

Browse Popular Code Answers by Language