title: How to get last element of an array in scala
body: <p>How to get the last element from array if present. In below code num contains array of elements</p>
  
  <pre><code> var line_ = ln.trim 
   if(!line_.isEmpty) {
       var num = line_.split(" ");
   }
  </code></pre>