fork(5) download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4.  
  5. int main() {
  6. std::string str = " abc";
  7. std::cout << "->" << str << "<-" << std::endl;
  8.  
  9. size_t startpos = str.find_first_not_of(" \t");
  10. if( std::string::npos != startpos )
  11. {
  12. str = str.substr( startpos );
  13. }
  14.  
  15. std::cout << "->" << str << "<-";
  16. return 0;
  17. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
->		    		            abc<-
->abc<-