Horje
string erase Code Example
remove or erase first and last character of string c++
str.pop_back(); // removes last /back character from str
str.erase(str.begin()); // removes first/front character from str
string erase
// Function to demo erase
void eraseDemo(string str)
{
    // Deletes 4 characters from index number 1
    str.erase(1, 4);
 
    cout << "After erase : ";
    cout << str;
}




Cpp

Related
string format decimal places c++ Code Example string format decimal places c++ Code Example
file streams in c++ Code Example file streams in c++ Code Example
c++ pass function as argument Code Example c++ pass function as argument Code Example
pointers mcq sanfoundry Code Example pointers mcq sanfoundry Code Example
passing custom function in sort cpp Code Example passing custom function in sort cpp Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10