For example I have the following string,
if (str[i] == \'(\' || str[i] == \')\' || str[i] == \'+\' || str[i] == \'-\' || str[i] == \'/\' || s
You may use the following:
const char s[] = "()+-/*"; if (std::any_of(std::begin(s), std::end(s), [&](char c){ return c == str[i]})) { // ... }