1、问题
C++字符串的切割
2、代码
#include <iostream>
#include <string>
#include <vector>std::vector<std::string> splite(const std::string &value, const std::string &pattern) {std::vector<std::string> result;if (value == "") {return result;}if (pattern == "") {result.push_back(value);return result;}std::string values = value;int value_size = value.size();int pattern_size = pattern.size();int index = 0;while (index != std::string::npos) {index = values.find(pattern);std::string little = values.substr(0, index);result.push_back(little);values = values.substr(index + pattern_size);}return result;}int main() {
// std::string value("chenyu#c