title: Convert String Array with nulls to Int Array in Scala
body: <p>Given Array(&quot;1&quot;,&quot;2&quot;,null,&quot;3&quot;), convert it to an integer array replacing null with 0.</p>
  <p>I know we can use the success/failure pattern but how can I do it with a simple case statment?</p>
  <pre><code>Array(&quot;1&quot;,&quot;2&quot;,null,&quot;3&quot;).map({
    case null =&gt; 0
    case _ =&gt; (_:String).toInt})
  </code></pre>
  <p>returns <code>Array(&lt;function1&gt;,&lt;function1&gt;,0,&lt;function1&gt;)</code></p>