Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ string remove last character

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
 
PREVIOUS NEXT
Tagged: #string #remove #character
ADD COMMENT
Topic
Name
7+7 =