这里有一些我自己写的c++轮子,可能效率不高,但是能用。
不定期更新,如果有错误或者bug还请不吝赐教。
git仓库
myString.cpp
内容:
- 函数
std::vector<std::string> sub_str(const std::string &str, const std::string &elements = " ")
接受一个待分割字符串str,分割字符集elements(默认为空格分隔),返回待分割字符中的各个“单词”。 - 函数
std::vector<std::string> sub_str(const char* &chs, const std::string &elements = " ")
接受一个待分割C-风格字符串chs,分割字符集elements(默认为空格分隔),返回待分割字符中的各个“单词”。