DEV Community

Discussion on: This time I did it in one line - a CodeWars challenge explanation

Collapse
protium profile image
Brian Mayo

What about using regular expression? 😃

return re.subn(r'[x|c]', '', s, flags=re.IGNORECASE)[1]