#include <iostream> using namespace std; int main() { string s = "madara"; s.substr(0, s.size() - 1); //madar //Another method: By resizing string s = "uchiha"; s.resize(s.size()-1); //uchih return 0; }