string name = "My String"; // To remove First character name.erase(name.begin()); // To remove Last character name.pop_back(); std::cout << name << std::endl; // Output : y Strin