title: substring of the first 4 characters from a textField in Swift 4
body: <p>I'm trying to create a substring of the first 4 characters entered in a textField in Swift 4 on my iOS app.</p>
  
  <p>Since the change to Swift 4 I'm struggling with basic String parsing. </p>
  
  <p>So based on Apple documentation I'm assuming I need to use the substring.index function and I understand the second parameter (offsetBy) is the number of characters to create a substring with.  I'm just unsure how I tell Swift to start at the beginning of the string.</p>
  
  <p>This is the code so far:</p>
  
  <pre><code>  let postcode = textFieldPostcode.text
  
    let newPostcode = postcode?.index(STARTATTHEBEGININGOFTHESTRING, offsetBy: 4)
  </code></pre>
  
  <p>I hope my explanation makes sense, happy to answer any questions on this.</p>
  
  <p>Thanks,</p>