title: How to get a substring in swift 4?
body: <p>I know we can use subscript to cut a part of the string in Swift 4, .</p>
  
  <pre><code>let s = "aString"
  let subS = s[..&lt;s.endIndex]
  </code></pre>
  
  <p>But the problem is, how to cut the <code>s</code> to a subString like <code>aStr</code>.<br>
  I mean, What I want to do is something like <code>s[..&lt;(s.endIndex-3)]</code>.<br>
  But it's not right.<br>
  So, how to do it in Swift 4.</p>