Click here to Skip to main content
13,087,797 members (81,462 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How to parsing a string as str?
stringstream strs;
string str = strs.str();
* How to parsing the str ?

Thanks for answering to my question.
Posted 25-Feb-12 0:34am
smss IR407
Richard MacCutchan 25-Feb-12 6:51am
Parsing for what?
Member 8238193 25-Feb-12 6:59am
for discern parameters.
On String exist many parameters such as Number(Player number on footbal [robocup]),Vector(Vector of target to going that).
I want to discern parameters for doing actions on WrightEagleBASE for robocup soccer simulation ( ).
for example, if string have "U@1V@(2,4)" then Player Number one , move to Point (2,4)
Richard MacCutchan 25-Feb-12 7:10am
You can use one of the string member functions to find the specific items within the string.
Member 8238193 25-Feb-12 7:58am
how can?
Richard MacCutchan 25-Feb-12 8:03am
By writing some code. I suggest you follow the link I provided and decide which member functions you need to use to get the results you want.
Member 8238193 25-Feb-12 8:08am
Your mean of link is ?
Edward Nutting 25-Feb-12 8:55am
No he means the link in his comment...The one that takes you to the MSDN page that you need to look at (the one you should have found yourself)...this one:
Member 8238193 25-Feb-12 10:01am
i can not understanding that link (
because I wanna to parse a string and i saw on that link, a specialization & prototype of string.
and i do not see any function for parsing.
Thanks for answering, Please help me to understand how to parsing a string.
Richard MacCutchan 25-Feb-12 10:38am
As I said before, you need to write some code, there is no existing function to parse your strings. Remember that the string you wish to parse is just a stream of characters, and it's up to you to design and write the algorithm that will split it into its constituent parts.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

u will get the char* using function string::c_str(), which can be used with sscanf function for easy parsing..

Hopes this helps somewhat..
Randor 25-Feb-12 17:54pm
But your profile says that you are from the United States. :)
jk chan 26-Feb-12 7:36am
i was lazy.
Member 8238193 26-Feb-12 8:04am
I quote from my friend :D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 25 Feb 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100