Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to check string contains char in c++

std::string s = "Hello";
if (s.find('e') != std::string::npos)
    cout << "Found";
else
    cout << "Not Found"; 
 
PREVIOUS NEXT
Tagged: #check #string #char
ADD COMMENT
Topic
Name
3+1 =