...

/

Solution: Erase the Capital Letters

Solution: Erase the Capital Letters

The solution to the challenge, "Exercise: Erase the Capital Letters".

We'll cover the following...

Solution

Press + to interact
#include <iostream>
#include <string>
int main() {
std::string str{"Only For TesTing PurPose."};
std::cout << "str: " << str << std::endl;
std::erase_if( str, [](char c){ return std::isupper(c); });
std::cout << "str: " << str << std::endl;
}

Applying the algorithm ...