how to to upper a whole string in c++ code example
Example 1: string to upper c++
std::string data = "This is a sample string.";
// convert string to upper case
std::for_each(data.begin(), data.end(), [](char & c){
c = ::toupper(c);
});
Example 2: convert all strings in vector to lowercase or uppercase c++
for(std::string &s : stringVector){
std::transform(s.begin(), s.end(), s.begin(),
[](char c){ return std::toupper(c); }); // for lowercase change "toupper" -> "tolower"
}