How to cut getline short

My input file has the following format
First Middle Last, First Middle Last, First Middle Last

The Middle is optional.
How can I do a getline and have it stop right before the comma? Or take the comma and then get rid of it?

1
2
string name;
getline(file,name,',');
That easy, eh?

:) Thanks a bunch!
Topic archived. No new replies allowed.