How to replace the first word in a series of occurrences like below.
Im trying to replace the first "/" in each line(if present) with a "", if not present, go to the next line in a text file.
ex: in.txt
Stackover flow /abc/one/two
is suitable to search three/four/five
answers for all /six/seven/eight
output like:
Stackover flow abc/one/two
is suitable to search three/four/five
answers for all six/seven/eight
I have tried re.sub with various combinations but not able to get any suitable answers. I hope to find answers here . Thanks in advance.