Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

remove last index of the string in c++

#include <iostream>
using namespace std;
int main()
{
    string input;
    cout<<“Enter a string : “<<endl;
    cin >> input;
    cout<<“Removed last character : “<<input.substr(0, input.size() - 1)<<endl;
}
Source by www.codevscolor.com #
 
PREVIOUS NEXT
Tagged: #remove #index #string
ADD COMMENT
Topic
Name
6+1 =