I want to replace part of the string to blank if present in a list.
For example :
List
foo = ['.com', '.net', '.co', '.in']
Convert these strings to
google.com
google.co.in
google.net
google.com/gmail/
These strings
google
google
google
google/gmail/
So far i have found this solution. Is there any other optimized way to do it?
replace item in a string if it matches an item in the list
'.co'and'.in'appended to the same string?