How can I check if a string contains char?
2 answers
Look at the documentation string::find
string::find
std::string s = "hell[o";
if (s.find('[') != std::string::npos)
; // found
else
; // not found
+29
source to share