title: Swift: Remove Last Character from a String If It's a Forward Slash
body: <p>I am using this code to check if the last char on a string is slash and remove it</p>
  <pre><code>if urlString.last == &quot;/&quot; {
      urlString = urlString.substring(to: urlString.index(before: urlString.endIndex))
  }
  </code></pre>
  <p>I was wondering if there is a cleaner way to do this in swift 3?</p>