I am triying to remove from a list, all words that contains "@"
string = "@THISISREMOVED @test2 @test3 @test4 a comment"
splitted = string.split()
for x in splitted:
if '@' in x:
splitted.remove(x)
string =' '.join(splitted)
print(string)
And it returns:
@test2 @test4 a comment
I want to delete ALL words that contains '@' not just the first one, how i can do that? Thanks