
16 Feb
2007
16 Feb
'07
10:39 a.m.
Hi, I want to tokenize a string based on one or multiple space or tab std::string s = " a b c d \te "; std::vectorstd::string tokens; boost::algorithm::split(tokens,s,boost::algorithm::is_any_of(" \t"),token_compress_on); copy(tokens.begin(),tokens.end(),ostream_iterator<string>(cout,"\n")); This gives more or less correct result, except it does not remove space/ tab from begin /end. It can be done like trim(s); and then call the above. But is there any other way it can be done in split itself ?