Addition to code (6.4.1)
Closed this issue · 1 comments
kosgdk commented
6.4.1 Option, Some, and None
def readInt(str: String): Option[Int] =
if(str matches "\\d+" ) Some(str.toInt) else None
Int can be negative. Change regex mask to "-?\\d+"
davegurnell commented
Another good spot!