title: Swift: How to get substring from start to last index of character
body: <p>I want to learn the best/simplest way to turn a string into another string but with only a subset, starting at the beginning and going to the last index of a character.</p>
  
  <p>For example, convert "www.stackoverflow.com" to "www.stackoverflow".  What code snippet would do that, and being the most swift-like? (I hope this doesn't bring a debate, but I can't find good lesson on how to handle substrings in Swift.</p>