I have got a list of strings that I am calling a filter.
filter = ["/This/is/an/example", "/Another/example"] Now I want to grab only the strings from another list that start with one of these two (or more, the list will be dynamic). So suppose my list of strings to check is this.
to_check= ["/This/is/an/example/of/what/I/mean", "/Another/example/this/is/", "/This/example", "/Another/freaking/example"] When I run it through the filter, I would get a returned list of
["/This/is/an/example/of/what/I/mean", "/Another/example/this/is"] Does anyone know if python has a way to do what I am talking about? Grabbing only the strings from a list that start with something from another list?
/Another/example_you_may_not_have_expected? Does that start with/Another/exampleor not?