Can I use 2 or more delimiters in C++ function getline?
<p>I would like to know how can I use 2 or more delimiters in the getline functon, that's my problem: </p>

<p>The program reads a text file... each line is goning to be like:</p>

<pre><code>   New Your, Paris, 100
   CityA, CityB, 200
</code></pre>

<p>I am using getline(file, line), but I got the whole line, when I want to to get CityA, then CityB and then the number; and if I use ',' delimiter, I won't know when is the next line, so I'm trying to figure out some solution..</p>

<p>Though, how could I use comma and \n as a delimiter?
By the way,I'm manipulating string type,not char, so strtok is not possible :/</p>

<p>some scratch:</p>

<pre><code>string line;
ifstream file("text.txt");
if(file.is_open())
   while(!file.eof()){
     getline(file, line);
        // here I need to get each string before comma and \n
   }
</code></pre>