extract char from string
c++, string
Solution
#include <iostream>
#include <string>
int main(int,char**)
{
std::string x = "HelloHello";
x.erase(x.begin());
std::cout << x << "\n";
return 0;
}
prints
elloHello
Problem
Having a string `HelloHello` how can I extract (i.e. omit) the first char, to have `elloHello`? I've thought of `.at()` and `string[n]` but they return the value and don't delete it from the string