I am trying to get a number out of an xml field
... 12 ...
via
Some((recipe \\ \"Main\" \\
scala> import scala.util.Try import scala.util.Try scala> def tryToInt( s: String ) = Try(s.toInt).toOption tryToInt: (s: String)Option[Int] scala> tryToInt("123") res0: Option[Int] = Some(123) scala> tryToInt("") res1: Option[Int] = None