I have a quick question about strings and how it can be viewed one character at a time, but I'm having troubles figuring out how to stop reading from a string after the second time. I have a email "firstname.lastname@whatever.com" and I've successfully extracted the firstname to my first string, the second string I'm at a complete loss of what I should do, the best I've gotten was "FirstName Lastname@whatever.com"
What I would like to happen is its just grabs the string and drop whatever is left after the '@' character.
`
FirstName = "";
LastName = "";
string::size_type i;
for (i = 0; !ispunct(Email.at(i)); i++)
FirstName = FirstName + Email.at(i);
for (i = i + 1; !ispunct(Email.length()); i++) // this right here ends up as "LastName@whatever.com"
LastName = LastName + Email[i];
`
I know I have to use !ispunct() but I'm just confused as of where or even how it works
Thanks in advance