title: How do I get the length of a String in Swift3 on macOS
body: <p>How do I get the length of a <code>String</code> in 'Swift3' on macOS?</p>
  
  <p>This used to work in Swift2:</p>
  
  <pre><code>if purchaseDateString.length == 0 {
       purchaseDateString = "n/a"
  }
  </code></pre>
  
  <p>What is Swift3 equivalent for finding String's length.</p>
  
  <p>UPDATE</p>
  
  <p>There are answers to this question as Martin points out. The referred question has 30 answers. However, as far as I can tell, none of them relate specifically to Swift3. I could be wrong..</p>