标签:
//c++之字符串分割: std::string str_buf = "hello/world"; std::vector<std::string> str_arr; split(str_buf, "/", str_arr); for(std::vector<std::string>::iterator it=str_arr.begin(); it != str_arr.end(); it++){ std::cout << "std::string is " << *it << std::endl; } //取vector的最后一个元素: std::string tmp = str_arr[str_arr.size()-1];
标签:
原文地址:http://www.cnblogs.com/chris-cp/p/4475429.html