Answers for "check if only specific characters exist in string c++"

C++
3

check if character in string c++

std::string s = "hell[o";
if (s.find('[') != std::string::npos)
    ; // found
else
    ; //
Posted by: Guest on September-14-2020
0

checking if a string has only letters cpp

#include <regex>

bool contains_non_alpha
    = !std::regex_match(name, std::regex("^[A-Za-z]+$"));
Posted by: Guest on October-19-2021

Code answers related to "check if only specific characters exist in string c++"

Browse Popular Code Answers by Language