Categories
How to remove a word from a string?
There is a code: name = 'Vasya vasya VASYA' you need to cut out all 'vasya' from name, the variable is not static, so as I understand it, regular expressions are needed, help me compose.
name = 'Vasya vasya VASYA'
Answer the question
In order to leave comments, you need to log in
re.sub(r"vasya", "", "Vasya foo vasya bar VASYA", 0, re.IGNORECASE)
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question