Reputation: 2353
I would like to have the String, "null"
converted to an Option[String] = None
.
Upvotes: 0
Views: 75
Reputation: 21
Alternatively,
def convertToOption(value: String): Option[String] = {
value match {
case "null" => None
case _ => Some(value)
}
}
Upvotes: 0