toupper in c++ string code example
Example 1: convert all characters in string to uppercase c++
transform(str.begin(), str.end(), str.begin(), ::toupper);
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"
}