title: Finding whether a string starts with one of a list's variable-length prefixes
body: <p>I need to find out whether a name starts with any of a list's prefixes and then remove it, like:</p>
  
  <pre><code>if name[:2] in ["i_", "c_", "m_", "l_", "d_", "t_", "e_", "b_"]:
      name = name[2:]
  </code></pre>
  
  <p>The above only works for list prefixes with a length of two. I need the same functionality for <strong>variable-length prefixes</strong>.</p>
  
  <p>How is it done efficiently (little code and good performance)?</p>
  
  <p>A for loop iterating over each prefix and then checking <code>name.startswith(prefix)</code> to finally slice the name according to the length of the prefix works, but it's a lot of code, probably inefficient, and "non-Pythonic".</p>
  
  <p>Does anybody have a nice solution?</p>