-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cpp
29 lines (25 loc) · 1.01 KB
/
test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <string>
#include <iostream>
using namespace std;
int main()
{
string text = "This, is sample, test application, 123";
string d = ",";
size_t begin = text.find_first_not_of (d);
size_t end = text.find_first_of(d, begin);
cout<<" begin: "<<begin<<" end: "<<end<<" d: "<<d<<endl;
cout<<" str: "<<text.substr(begin,end - begin)<<endl;
begin = text.find_first_not_of (d, end+1);
end = text.find_first_of(d, end+1);
cout<<" begin: "<<begin<<" end: "<<end<<" d: "<<d<<endl;
cout<<" str: "<<text.substr(begin,end - begin)<<endl;
begin = text.find_first_not_of (d, end+1);
end = text.find_first_of(d, end+1);
cout<<" begin: "<<begin<<" end: "<<end<<" d: "<<d<<endl;
cout<<" str: "<<text.substr(begin,end - begin)<<endl;
begin = text.find_first_not_of (d, end+1);
end = text.find_first_of(d, end+1);
cout<<" begin: "<<begin<<" end: "<<end<<" d: "<<d<<endl;
cout<<" str: "<<text.substr(begin,end - begin)<<endl;
return 0;
}