16 std::string
union_words(
const std::string& wordsA,
const std::string& wordsB) {
17 std::string words = wordsA;
19 std::string::const_iterator it = wordsB.begin();
21 while (it != wordsB.end())
24 while (*it ==
' ' || *it ==
'\n' || *it ==
'\t' || *it ==
'\r') {
25 if (++it == wordsB.end())
break;
28 std::string::const_iterator i1 = it;
31 while (it != wordsB.end() &&
32 *it !=
' ' && *it !=
'\n' && *it !=
'\t' && *it !=
'\r')
35 std::string w(i1, it);
bool contains_word(const std::string &str, const char *word)
Search the given string for a whitespace-delimited word.
std::string union_words(const std::string &wordsA, const std::string &wordsB)
Return union of two keyword sets.