【发布时间】:2020-06-19 09:57:57
【问题描述】:
代码是:
vector<string> result;
string input = "Ellipse(50, 50, 200, 300)"
boost::split(result, input, boost::is_any_of("(, )"))
int i=0;
for (auto at=result.begin(); at != result.end(); at++)
cout << ++i << " " << *at << endl;
输出是:
1 Ellipse
2 50
3
4 50
5
6 200
7
8 300
9
我只想得到椭圆和整数,而不是空格。
我怎样才能得到正确的结果?
输入字符串不能更改。
【问题讨论】:
-
在字符串中尝试过反斜杠空格吗?
"(,\ )"