Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

delete everything from list that matches string

new_list = [x for x in old_list if not x.startswith('@$	') and not x.endswith('#')]

['this doesnt', 'this shouldnt', 'this isnt', 'this musnt']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #list #matches #string
ADD COMMENT
Topic
Name
5+2 =