1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include <iostream>
#include "boost/algorithm/string/trim.hpp"

using namespace std;
using namespace boost::algorithm;

int main ( int argc, char *argv[] ){
   string str1( argv[1] );
   string str2 = trim_right_copy( str1 );
   cout << str1 << "#" << endl;
   cout << str2 << "#" << endl;
   trim_right( str1 );
   cout << str1 << "#" << endl;
}