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.`
Comparing strings in a case insensitive manner means to compare them without taking care of the uppercase and lowercase letters.
String comparison is case sensitive by default. Just use operator== for std::string .
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.
No, C++11 did not introduce a case-insensitive string comparison function. You'll need to stick with Boost for now.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With