Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SCALA

how to transform Nil to None scala

Nil is an empty Sequence and None is an empty Option. So use .headOption on your Nil variable

val myVal = Nil

println(myVal.headOption)
 
PREVIOUS NEXT
Tagged: #transform #Nil #None #scala
ADD COMMENT
Topic
Name
2+6 =