更新时间:2022-11-14 16:43:25
您正在问如何拆分字符串。 Boost有一个有用的实用程序boost :: split()
You are asking how to split a string. Boost has a helpful utility boost::split()
http://www.boost.org/doc/libs/1_48_0/doc/html/string_algo/usage.html#id3115768
这里有一个例子,将结果的单词放入一个向量:
Here's an example that puts the resulting words into a vector:
#include <boost/algorithm/string.hpp>
std::vector<std::string> strs;
boost::split(strs, "string to split", boost::is_any_of("\t "));