Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Did C++11 introduce a case-insensitive string comparison algorithm?

Tags:

c++

c++11

stl

boost

Just moved to C++11 on GCC 4.8 and would be nice to move away from boost::iequals in favor of STL. I searched around the interwebs but I didn't see any signs of std::iequals or new std::basic_string methods to support this natively in STL.

If this doesn't exist in C++11, has the approach to solving this problem changed since C++03 (i.e. different workarounds?), or is boost still preferred here?

Thanks in advance.`

like image 711
void.pointer Avatar asked Sep 10 '14 03:09

void.pointer


People also ask

What is case insensitive string comparison?

Comparing strings in a case insensitive manner means to compare them without taking care of the uppercase and lowercase letters.

Is string comparison case sensitive in C++?

String comparison is case sensitive by default. Just use operator== for std::string .

How do you ignore capitalization in C++?

The strcasecmp() function performs a byte-by-byte comparison of the strings s1 and s2, ignoring the case of the characters. It returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2.


1 Answers

No, C++11 did not introduce a case-insensitive string comparison function. You'll need to stick with Boost for now.

Hope this helps!

like image 198
templatetypedef Avatar answered Nov 15 '22 05:11

templatetypedef