In my function, I am using .find and I need to be using .at, because the way I have it now doesn't account for extra whitespace etc., but I have no idea how to implement this change. I looked through the internet and I can't find a good example of the .at in work. I have an input of names:
firstname lastname and I need it to be
lastname, firstname .
My program "works", except it's bad style and I need to be using .at
Any suggestions or a good resource I can check for an example?
string parseInputString (string oneline)
{
string newName;
string firstName, lastName;
int index;
index = oneline.find (' ');
firstName = oneline.substr(0, index);
oneline = oneline.substr(index + 1, oneline.length() - 1);
lastName = oneline;
newName = lastName + ", " + firstName + ".";
return newName;
}