title: Compilation Error : 'value foreach is not a member of Unit'
body: <p>Hi Given below is the code. The function <code>Split_line</code> returns an Array. I suppose the value <code>splitted</code> should be of type <code>Array</code>. But is considered as <code>Unit</code> by the Compiler. What am I doing wrong here?</p>
  
  <pre><code>object Main {
  
    def Split_line(line: String){
      line.split("\\|\\|")    
    }
  
    def main(args: Array[String]) {
      val splitted = Split_line("This is a line || hi ")
      //***I am getting error here : 'value foreach is not a member of Unit'
      splitted.foreach(println) 
    }
  
  }
  </code></pre>