Question: Is there a more compact and efficient way of stripping a string of any suffix from a given list, i.e.:

```
sfxs = ['suffix1', 'sfx2', 'suffix333']
s = 'string-to-process-sfx2'
for sfx in sfxs:
    i = s.find(sfx)
    if not i == -1:
        s = s[:i]
        break

```

Suffixes are of different lengths

Answer: 
```
sfxs = ['suffix1', 'sfx2', 'suffix333']
s = 'string-to-process-sfx2'
for sfx in sfxs:
    if s.endswith(sfx):
        s = s[:-len(sfx)]
        break
print(s)

```

is slightly more efficient because the string comparison looks at the end of the string only.
```
sfxs = ['suffix1', 'sfx2', 'suffix333']
s = 'string-to-process-sfx2'
for sfx in sfxs:
    if sfx in s:
        s.replace(sfx, "")

```

Should do it. Check to ensure the suffix is in the string, then remove it if it is.