我有一组字符串,然后是一些第二个字符串。我想遍历该集合并确定当前字符串是否包含在第二个字符串中。有没有从STL
或任何这些包括可以减轻我的工作的任何工具?如何确定一个字符串是否包含另一个字符串
#include <cctype>
#include <iostream>
#include <iomanip>
#include <set>
#include <list>
#include <map>
#include <vector>
#include <queue>
#include <string>
USECASE:
test1 . Add (0, "hello");
test1 . Add (1, "world");
test1 . Add (2, "rld");
test1 . Add (3, "ell");
test1 . Add (4, "hell");
printSet (test1 . Search ("hello world!"));
// 0, 1, 2, 3, 4
printSet (test1 . Search ("hEllo world!"));
// 1, 2
当然,我可以通过字符字符串的字符串,性格比较它还是创造了一些自动的,但为什么做事情更难,比他们实际上可以是:)
['的std :: string :: find()方法'](http://en.cppreference.com/w/cpp/string/basic_string/find)? – hmjd