title: Get all object from NSMutableArray into string using for loop
body: <p>In my code I have an <code>NSMutableArray</code>. I want to get all values from that array into <code>String</code> and I want to send to the server. I used a <code>for</code> loop but it doesn't work. I don't know what I did wrong. Please help to fix the issue.</p>
  
  <p>Here the code I tried.</p>
  
  <pre><code>var newString1 = String()
  for i in (0..&lt;self.idMutableArray.count)
  {
      newString1 = (idMutableArray.object(at: i) as! NSString) as String
      print("newString1 is ",newString1)
  }
  print("newString1 is ",newString1)
  </code></pre>
  
  <p>The mutable array Format is:</p>
  
  <pre><code>idMutableArray is  (
          31,
          30,
          29,
          42,
          50
      )
  </code></pre>
  
  <p>When I am tried I get this format:</p>
  
  <pre><code>newString1 is  29
  newString1 is  30
  newString1 is  31
  newString1 is  42
  newString1 is  50
  </code></pre>
  
  <p>But I want to send this format to the server.</p>
  
  <pre><code>newString1 = 31,30,29,42,50
  </code></pre>
  
  <p>I don't know how to change that array to string format. Please help me.</p>