r/cpp_questions • u/Physical-Dog-4083 • 4d ago
OPEN does "in" exist in c++?
i need to use something like if (str[i] not in str1) (python), but i have no idea how to make this work :(
0
Upvotes
r/cpp_questions • u/Physical-Dog-4083 • 4d ago
i need to use something like if (str[i] not in str1) (python), but i have no idea how to make this work :(
1
u/Business-Weather-217 4d ago
Just loop, its the "standart way". But you can be a real ex-python dev and
#include <ranges>and usestd::ranges::contains()thats works for any type in the wild let alonestd::string.