
Сообщение от
easybudda
ну так сделайте себе такую функцию, если нужна...
Не обязательно делать, можно использовать, например,
boost::split
C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iterator>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
int main()
{
std::string s("Hello| world|A B");
std::vector<std::string> v;
boost::split(v, s, boost::is_any_of("|"));
std::copy(v.begin(), v.end(), std::ostream_iterator<std::string>(std::cout, "\n"));
return 0;
} |
|
http://liveworkspace.org/code/7423a1378f22f85d760fea13e11f14a9