i need a help to remove some characters with python Code :
txt = 'Congo (Congo-Brazzaville)'
can i remove characters starting from ( to )
so that txt after that is like : 'Congo'
i need a help to remove some characters with python Code :
txt = 'Congo (Congo-Brazzaville)'
can i remove characters starting from ( to )
so that txt after that is like : 'Congo'
Try with re
package:
>>> import re
>>> txt = re.sub("\(.*\)", "", txt)
>>> txt
'Congo '