I have an Option[String].
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
All proposed solutions will crash with NullPointerException if you pass:
val str : Option[String] = Some(null).
Therefore null-check is a must:
def isBlank(input: Option[String]): Boolean = input.filterNot(s => s == null || s.trim.isEmpty).isEmpty