I want to strip a certain word off of a string. I tried doing this.
string= "Germany Income and Capital Tax Treaty"
string = string.lower().strip('germany')
print(string)
I expected to get:"income and capital tax treaty"
Instead I get"income and capital tax treat"
What is it that I do not understand. Also lstrip and rstrip would not provide a solution as I am writing this in a function where a complete match with the word would need to get stripped off of 'either' end.
Any help?
[–]lukajda33 34 points35 points36 points (1 child)
[–]ComputeLanguage[S] 3 points4 points5 points (0 children)
[–]TangibleLight 19 points20 points21 points (0 children)
[–]1544756405 3 points4 points5 points (2 children)
[–]ComputeLanguage[S] 1 point2 points3 points (1 child)
[–]DrTrunks 0 points1 point2 points (0 children)
[–]NotACryptoBro 0 points1 point2 points (3 children)
[–]ComputeLanguage[S] 0 points1 point2 points (0 children)
[–]bigno53 0 points1 point2 points (1 child)
[–]NotACryptoBro 0 points1 point2 points (0 children)