replace a character python
sentence = ' mam a a mam ' sentence = re.sub(' a ', ' ', sentence) print(sentence) output: mam a mam expected output: mam mam is there a short and simple solution to this problem??
Calvin [Inactive] thanks but is there a way to use metacharactors to do this??
re.sub() matches all occurences of the pattern if no count parameter has been set. So pay attention to the blanks in your pattern and replacement strings. They should be " a" and an empty string, just two quotes without anything in between : ''. I deleted some blanks, tried your code and got the expected output.
Delorme can u please share the program??
Please help, any idea?
Loop question, I've tried everything that I knew I just don't know. Please help me solve it out
What is wrong? Error on test.
Help me solve this (using loop)
Help me wiht python
how can i flip any word with c++