首页 > 编程语言 > 详细

c++ 字符窜切割

时间:2015-02-26 18:02:53      阅读:275      评论:0      收藏:0      [点我收藏+]
std::vector<std::string> Tools::SplitStr(const char* baseStr, const char* rule)
{
    log("baseStr: %s",baseStr);
    std::vector<std::string> tempList;

    std::string str;
    char* item;
    item = strtok((char*)baseStr, rule);
    while (item)
    {
        str = item;
     log("item: %s", str.c_str());
tempList.push_back(str); item = strtok(NULL, rule); } return tempList; }

 

c++ 字符窜切割

原文:http://www.cnblogs.com/JD85/p/4301485.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!