Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- int main() {
- std::string str("/comando ");
- std::cout << str << "-" << std::endl;
- size_t endpos = str.find_last_not_of(" ");
- if( std::string::npos != endpos ) {
- str = str.substr( 0, endpos+1 );
- }
- std::cout << str << "-" << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement