How can I remove the first letter of a string?
Thank you!
mystring.erase(mystring[0]);
Last edited on
1 2 3 4 5 6 7 8 9 10
|
#include <iostream>
using std::cout;
using std::string;
int main(){
string s = "Random string";
cout << s.substr(1) << '\n';
cout << s.replace(0,1,"") << '\n';
}
|
Last edited on