I have a string which I input as follows
using namespace std;
string s;
getline(cin, s);
I input
a.b~c.d
I want to split the string at .
and ~
but also want to store the delimiters. The split elements will be stored in a vector.
Final output should look like this
a
.
b
~
c
.
d
I saw a solution here but it was in java.
How do I achieve this in c++?