title: 'substring(to:)' is deprecated: Please use String slicing subscript with a 'partial range upto' operator
body: <p>How can I update the following code to the new version of swift: </p>
  
  <pre><code>self.areaCodeLael.text! = localNumber.substring(to: localNumber.index(localNumber.startIndex, offsetBy: 3))
  </code></pre>
  
  <p>I have tried following this post but I can't get it right 
  <a href="https://stackoverflow.com/questions/45562662/how-to-use-string-slicing-subscript-in-swift-4">How can I use String slicing subscripts in Swift 4?</a></p>
  
  <p>I adjusted my original code to <code>localNumber[..&lt;3]</code> but I get:</p>
  
  <blockquote>
    <p>Cannot subscript a value of type 'String' with an index of type 'PartialRangeUpTo'</p>
  </blockquote>