No, std::getline
() only accepts a single character, to override the default delimiter. std::getline()
does not have an option for multiple alternate delimiters.
The correct way to parse this kind of input is to use the default std::getline
() to read the entire line into a std::string
, then construct a std::istringstream
, and then parse it further, into comma-separate values.
However, if you are truly parsing comma-separated values, you should be using a proper CSV parser.