Scala Check optional string is null or empty
<p>I am a newbie to Scala and I want to learn how can I add null and empty check on an <strong>optional</strong> string? </p>

<pre><code>val myString : Option[String]

if (null != myString) {
  myString
    .filter(localStr=&gt; StringUtils.isEmpty(localStr))
    .foreach(localStr=&gt; builder.queryParam("localStr", localStr))
}
</code></pre>

<p>Above code works but I want to learn some elegant way of writing same check. Any help is highly appreciated, </p>

<p>thanks</p>