C-style for statement has been removed in Swift 3 (Continuos error)
<p>I have had this problem since updating to <code>Swift 3</code>. I have tried updating this to <code>Swift 3</code> by using <code>stride(from:to:by:)</code> but I can't implement the old <code>Swift 2</code> code to the <code>Swift 3</code> code. Below I have included my code:</p>

<pre><code>for var i = 0; i &lt;= self.senderArray.count - 1; i += 1 {

  if self.senderArray[i] == userName {

         self.other2Array.append(self.otherArray[i])
  }
  else {    

     self.other2Array.append(self.senderArray[i])
  }              

  self.message2Array.append(self.messageArray[i])
  self.sender2Array.append(self.senderArray[i])

  }
</code></pre>

<p>The error I am getting:</p>

<blockquote>
  <p>C-style for statement has been removed in Swift 3</p>
</blockquote>

<p>I have tried this method below, but it doesn't work:</p>

<pre><code>for i in 0 ..&lt; self.senderArray.count
</code></pre>

<p>Before anyone marks this question as a duplicate I have had a look at the following questions but for some reason, I can't figure out how to implement my code into  the updated <code>Swift 3</code> code.</p>

<p><a href="https://stackoverflow.com/questions/36173379/warning-c-style-for-statement-is-deprecated-and-will-be-removed-in-a-future-ve">#warning: C-style for statement is deprecated and will be removed in a future version of Swift</a></p>

<p><a href="https://stackoverflow.com/questions/36153839/how-to-fix-c-style-for-statement">How to fix C-style for statement?</a></p>

<p><a href="https://stackoverflow.com/questions/36213333/fix-warning-c-style-for-statement-is-deprecated-in-swift-3">Fix warning &quot;C-style for Statement is deprecated&quot; in Swift 3</a></p>

<p><a href="https://stackoverflow.com/questions/37814867/fix-c-style-for-statement-is-deprecated-in-swift">https://stackoverflow.com/questions/37814867/fix-c-style-for-statement-is-deprecated-in-swift</a></p>