#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <format>
using namespace std;
int main()
{
string str = "Hello World!";
string str2 = str, str3 = str;
cout << format("remove 전 : {}\n", str);
auto iter = remove(str.begin(), str.end(), ' ');
cout << format("remove 후 : {}, 이터레이터 맨 마지막 원소 : {}\n", str, *iter);
str2.erase(remove(str2.begin(), str2.end(), ' '), str2.end());
cout << format("erase + remove 후 : {}\n", str2);
str3.erase(remove_if(str3.begin(), str3.end(), ::isspace), str3.end());
cout << format("erase + remove_if + isspace 후 : {}\n", str3);
}