Hello

I have a file that contain different content, some lines inside that file looks like that :

Time : xx:xx:xx
Time : xx:xx:xx

So, I want to grab lines that start with "Time : " and put them inside a list<string> for later use. I am using windows so I don't know if the newline character is '\n' or '\r' also I don't want my grabed line contain any special character.

I have this code, but didn't work well because some special characters remain inside the string.

Code:
string buf;
list<string> ls;

ifstream read("test.txt", ios_base::binary);

while(!read.eof())
{
      getline(read,buf,'\n');
      if(buf[0]=='T' && buf[1]=='i' && buf[2]=='m' && buf[3]=='e')
      {
            ls.push_back(buf);
      }
}