human
Parse string to int when string contains a number + extra characters
assistant
Here is some code to parse string `s` to int when string contains a number

int(''.join(c for c in s if c.isdigit()))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.