title: Kotlin: Cast ArrayList<String!> to Array<String>
body: <p>I am trying to split a string that is input by the user. My code looks similar to the following:</p>
  
  <pre><code>val aList = Array(5, {Array&lt;String&gt;(2){ " " }})
  aList[0] = ArrayList(input.nextLine().split(" "))  // `split` returns a List
  </code></pre>
  
  <p>But this results in the following error:
  <code>error: type inference failed. Expected type mismatch: inferred type is ArrayList&lt;String!&gt; but Array&lt;String&gt; was expected</code>.</p>
  
  <p>After some digging around I found that the <code>T!</code> operator means <code>T or T?</code>. How can I cast <code>ArrayList&lt;String!&gt;</code> to <code>Array&lt;String&gt;</code>?</p>