convert all strings in vector to lowercase or uppercase c 2b 2b

Solutions on MaxInterview for convert all strings in vector to lowercase or uppercase c 2b 2b by the best coders in the world

showing results for - "convert all strings in vector to lowercase or uppercase c 2b 2b"
Carina
01 Jan 2020
1for(std::string &s : stringVector){
2    std::transform(s.begin(), s.end(), s.begin(), 
3        [](char c){ return std::toupper(c); }); // for lowercase change "toupper" -> "tolower" 
4}