I don't do code much with c++ so here is a question I have with this string.
string - param 1: CP:0_PL:0_OID:_CT:[W]_ `6<`2Username``>`` `$`$Hello world!!````
I want to get the message "hello world" and nothing else.
1 2 3 4 5 6 7 8 9
//I have tried something similar to my previous question
std::string str = "param 1: CP:0_PL:0_OID:_CT:[W]_ `6<`2Username``>`` `$`$Hello world!!````";
std::getline(param1, name, '$');
std::getline(param1, name, '`'); // cannot really do that, since there will be ` before my message.
std::cout << name << '\n';
Not really sure how I could get the string from there, really a pain.. Any suggestion?
Perhaps you want to give more details, constraints, and examples.
What exactly delimits what you want to parse out? Given that string, how do I know that I don't want to extract "Username" out of it, instead of "Hello World"?
Here's a short example that will find the first '$' in the string, extract everything after that string, and then remove the ` $ ! punctuation.