title: Flexible code to build a CSV-String in Swift 4.2
body: <p>I have a small problem and don‘t know how to solve this.
  I have got three (or more) Arrays and want to create a CSV-String with a universal function of them.</p>
  
  <p>For example:</p>
  
  <pre><code>var firstname = ["Phil", "Kate", "Wendy", "Nick"]
  var street = ["Groove Street", "Howard Street", "Highway 98", "Wall Street"]
  var country = ["United Kingdom", "Australia", "Canada", "New Zealand"]
  </code></pre>
  
  <p>My goal is it to create a function in this type:</p>
  
  <pre><code>func csvCreator([“firstname“,“street“,“country“]) -&gt; String {}
  //the integration of the array is wrong
  </code></pre>
  
  <p>The output should be:</p>
  
  <pre><code>csvString = “firstname;street;country\nPhil;Groove Street;United Kingdom\nKate;Howard Street;Australia\nWendy;Highway 98;Canada\nNick;Wall Street;New Zealand
  </code></pre>
  
  <p>I want to keep my code flexible, so that I can simply add another category (for example an array of ages) by writing the function like this:</p>
  
  <pre><code>var age =  ["22", "21", "44", "16"]
  func csvCreator([“firstname“,“street“,“country“,“age“]) -&gt; String {}
  //the integration of the array is wrong 
  </code></pre>
  
  <p>The name of the variables should be asked in the function with an array.</p>