Answers for "character string c++"

C++
2

find character in string c++

auto char_to_find = 'a'
if (str.find(char_to_find) != std::string::npos) {
    // character found
}
Posted by: Guest on September-15-2020
0

c++ read each char of string

std::string str = ???;
for(std::string::iterator it = str.begin(); it != str.end(); ++it) {
    do_things_with(*it);
}
Posted by: Guest on November-12-2020

Code answers related to "character string c++"

Browse Popular Code Answers by Language