Answers for "std::transform(str.begin(), str.end(), str.begin(), ::toupper);"

C++
3

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);
});
Posted by: Guest on May-09-2020

Browse Popular Code Answers by Language