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
Post a Comment