What are the equivalents of the functions strcmpi()
, strncmp()
and strncmpi()
for C++ style strings?
Please do not suggest using things like strcmpi(str1.c_str, str2.c_str)
etc.
Thanks in advance for any help.
What are the equivalents of the functions strcmpi()
, strncmp()
and strncmpi()
for C++ style strings?
Please do not suggest using things like strcmpi(str1.c_str, str2.c_str)
etc.
Thanks in advance for any help.
If you're using Boost you could use this to do case-insensitive comparation:
#include <boost/algorithm/string.hpp>
std::string str1 = "hello, world!";
std::string str2 = "hELLO, World!";
if (boost::iequals(str1, str2))
{
// Strings are identical
}