I am a newbie to Scala and I want to learn how can I add null and empty check on an optional string?
val myString : Option[String]
if (null != myString) {
myString
.filter(localStr=> StringUtils.isEmpty(localStr))
.foreach(localStr=> builder.queryParam("localStr", localStr))
}
Above code works but I want to learn some elegant way of writing same check. Any help is highly appreciated,
thanks
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)