Finding if all elements in a vector<string> are in a string
- by devin
I have a vector and I need to see if all the strings in that vector are substrings of another given string.
eg
vector<string> v;
v.push_back("str1");
v.push_back("str2");
string s1 = "str1, str2, str3";
string s2 = "str1, str3";
Is there a way to get true from s1 and false from s2 without looping over the vector? Also, note that due to my environment, I can't use boost. I think if I had boost, I could do this.