📜  python过滤字符串列表 - Python代码示例

📅  最后修改于: 2022-03-11 14:45:10.772000             🧑  作者: Mango

代码示例2
# To support matches from the beginning, not any matches:

items = ['a', 'ab', 'abc', 'bac']
prefix = 'ab'

filter(lambda x: x.startswith(prefix), items)