Python // Remove String // Array -


i have array including u-strings (the array can larger or shorter; elements occurrence can different)

[u'alpha beta gamma', u'delta-espilon phi', u'alpha&omega theta', u'delta&epsilon ny', u'delta gamma xeta theta 53422']  

i remove elements array not include delta? if delta included whole element should stay. array should shrink size of elements include delta.

has way how to?

you can use list comprehension perform filtering

>>> [i in l if 'delta' in i] ['delta-espilon phi', 'delta&epsilon ny', 'delta gamma xeta theta 53422'] 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -