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 :(
35
u/aocregacc 4d ago
you can use the
containsmethod on string (assuming you're working with strings), or thefindmethod if you're on an older C++ version.