firedraco, to respond to your first statement, perhaps I am stating it incorrectly. I will try to explain it in a broader manner.
To answer your final question, yes, I want the characters/numbers BETWEEN certain symbols (typically colons, spaces, and or commas).
In the given string, I want to be able to take ANY part of it and be able to take that part of the string and erase everything else so all I have is that part of the string,
|
"hi, 9, 38287.393, 3:30, lol"
|
I want to know how to make the string = "hi", "9", or "38287", "393", "38287.393", "3", "30", or "lol".
I think if I knew how to issue the command "Find symbol X and erase everything before it" and command "Find symbol Y (or X) and erase everything after it" I could accomplish this. I've done it before, but I've lost the code and can't reference it. The problem is, that the various parts of the string may vary in how many spaces they take up, so I can't use definitive numerical values to represent the locations, I need to base it upon certain characters, such as ":", " ", "\n", ",", (colon, space, newline, or comma, respectively).
I previously thought it was something along the lines of:
1 2 3 4
|
if (part1.find(",")!=string::npos)
{
part1.erase(",");
}
|
I thought that would erase everything up to and (possibly including) the "," but I don't see that happening. Or doing:
1 2 3 4
|
if (part1.find(","!=string::npos)
{
part1.erase();
}
|
Thinking the "if" statement would move the position to the position of the comma and that the part1.erase() would take that position and erase everything after it, but my results, comparisons to what I've read on various websites (including this one) don't seem to be supportive of that.