[ create a new paste ] login | about

Project: boost
Link: http://boost.codepad.org/ybbmMUEc    [ raw code | output | fork ]

C++, pasted on Dec 31:
#include <boost/algorithm/string.hpp> 
#include <locale> 
#include <iostream> 
#include <vector> 

int main() 
{ 

  
  std::string s = "Boris Schäling"; 
  std::vector<std::string> v; 
  boost::algorithm::split(v, s, boost::algorithm::is_space()); 
  std::cout << v.size() << std::endl; 
  
  
  
  BOOST_FOREACH(std::string elem, v )
    {
	    std::cout << elem << std::endl;
    }

} 


Output:
1
2
3
2
Boris
Schäling


Create a new paste based on this one


Comments: