title: Removing prefix from a string using a list of prefixes
body: <p>I was wondering how I could remove any prefix included in a list of prefixes (e.g: ["the", "a", "an"] from a given string (e.g: "A big red planet" -> "big red planet"). </p>
  
  <p>I have tried with this idea, but I do not know if it is the correct or the most efficient one.</p>
  
  <pre><code>extension String {
    func removing(prefixes: [String]) -&gt; String {
      var resultString = self
      prefixes.map {
        if resultString.hasPrefix($0) {
          resultString = resultString.dropFirst($0.count).description
        }
      }
      return resultString
    }
  }
  </code></pre>
  
  <p>Idea comes from this answer: <a href="https://stackoverflow.com/questions/47455364/how-to-create-a-dictionary-by-first-letter-of-title-but-ignore-articles-like-th">How to create a dictionary by first letter of title but ignore articles like &quot;the&quot; or &quot;a/an&quot; etc</a></p>