I want to convert a std::string to lowercase. I am aware of the function tolower(), however in the past I have had issues with this function and it
std::string
tolower()
Boost provides a string algorithm for this:
#include std::string str = "HELLO, WORLD!"; boost::algorithm::to_lower(str); // modifies str
Or, for non-in-place:
#include const std::string str = "HELLO, WORLD!"; const std::string lower_str = boost::algorithm::to_lower_copy(str);