I have an Option[String]
.
I want to check if there is a string exists and if it\'s exists its not blank.
def isBlank( input : Option[Strin
I added a Scalafiddle to play with that: Scalafiddle
That shows the marked correct answer is wrong (as pointed out by prayagupd):
def isBlank(str: Option[String]): Boolean =
str.forall(_.trim.isEmpty)
the solution is for non-blank:
def isNotBlank(str: Option[String]): Boolean =
str.exists(_.trim.nonEmpty)