title: Join string array with separator ", " and add ", and " to join the last element in Swift
body: <p>I'm messing around with parsing JSON with SwiftyJSON on a swift playground. My code is as follows:</p>
  
  <pre><code>import UIKit
  import SwiftyJSON
  
  var partyList: [String] = []
  var firstPresidentList: [String] = []
  
  if let url = URL(string:"http://mysafeinfo.com/api/data?list=presidents&amp;format=json") {
      if let data = try? Data(contentsOf: url) {
          let json = JSON(data: data)
          for i in 1...43 {
              let party = json[i]["pp"].stringValue
              let president = json[i]["nm"].stringValue
              if partyList.contains(party) {
                  print("\n")
              } else {
                  partyList.append(party)
                  firstPresidentList.append(president)
              }
          }
          print("All the different parties of U.S. presidents included "+partyList.joined(separator: ", ")+", in that order. The first presidents of those parties were (repectively) "+firstPresidentList.joined(separator: ", ")+".")
      }
  }
  </code></pre>
  
  <p>On the <code>print</code> line, I was wondering how I could join the arrays with a comma and space like I have, but add "and" before the last one.</p>
  
  <p>Thank you!</p>