An idiomatic way of converting an Option[String] into an Option[Int] in Scala31 Mar, 2014 in scala / software development by This always returns an Option[Int] Option("bad") filter { _ != None } map { catching(classOf[NumberFormatException]) opt _.toInt } getOrElse None No related content found.