Sample data
files.in.path = c("a.4.0. name 2015 - NY.RDS", 
                  "b.4.0. name 2016 - CA.RDS", 
                  "c.4.0. name 2015 - PA.RDS")
strings.to.find = c("4.0", "PA")
I want the logical vector that shows all elements that contain all strings.to.find. The result wanted:
FALSE FALSE TRUE
This code will find elements that contain any one of the strings.to.find, i.e., uses an OR operator
str_detect(files.in.path, str_c(strings.to.find, collapse="|")) # OR operator
 TRUE TRUE TRUE
This code attempts to use an AND operator but does not work.
str_detect(files.in.path, str_c(strings.to.find, collapse="&")) # AND operator
FALSE FALSE FALSE
This works in several lines and I can write a for loop that will generate all the individual lines for cases with a larger number of strings.to.find
det.1 = str_detect(files.in.path,      "4.0"  )   
det.2 = str_detect(files.in.path,      "PA"  )   
det.all = det.1 & det.2
 FALSE FALSE  TRUE
But is there a better way that does not involve using regex that depend on the position or order of the strings.to.find.
 
     
     
    