title: Scala Appending to an empty Array
body: <p>I am trying to append to an array but for some reason it is just appending blanks into my Array. </p>
  
  <pre><code>  def schemaClean(x: Array[String]): Array[String] =
    {
      val array = Array[String]()
      for(i &lt;- 0 until x.length){
        val convert = x(i).toString
        val split = convert.split('|')
        if (split.length == 5) {
          val drop = split.dropRight(3).mkString(" ")
          array :+ drop
        }
        else if (split.length == 4) {
          val drop = split.dropRight(2).mkString(" ")
          println(drop)
          array :+ drop.toString
          println(array.mkString(" "))
        }
      }
     array
    }
  
  
    val schema1 = schemaClean(schema)
  </code></pre>
  
  <p>prints this: </p>
  
  <pre><code>record_id string
  
  assigned_offer_id string
  
  accepted_offer_flag string
  
  current_offer_flag string
  </code></pre>
  
  <p>If I try and print schema1 its just 1 blank line. </p>