I have a text file that I want to read. I want to know if one of the lines contains [
so I tried :
if(array[i] == "[")
But this isn't working.
How can I check if a string contains a certain character?
Look at the documentation string::find
std::string s = "hell[o";
if (s.find('[') != std::string::npos)
; // found
else
; // not found