How to find the python list item that start with

后端 未结 3 559
庸人自扰
庸人自扰 2020-12-14 12:32

I have the list that contains some items like:

\"GFS01_06-13-2017 05-10-18-38.csv\"
\"Metadata_GFS01_06-13-2017 05-10-18-38.csv\"

How to fi

3条回答
  •  离开以前
    2020-12-14 13:26

    You should try something like this :

    [item for item in my_list if item.startswith('GFS01_')]
    

    where "my_list" is your list of items.

提交回复
热议问题