Hi to all.

I want to find a specific string between lines to remove it, I'm usign readLine() to read a text with TextStream.
for example:

Qt Code:
  1. QTextStream text(&file);
  2. while(!text.atEnd()){
  3. vectorData[ii] = text.readLine();
  4. ...
  5. ii++;
  6. }
To copy to clipboard, switch view to plain text mode 

the read is something like:

Banana
Kiwi
Apple
Banana
Banana
Apple
Mango
Apple
Mango

so, I want to remove the Apple line just after the Banana line.

Banana
Kiwi
Apple
Banana
Banana
Apple <--- This one
Mango
Apple
Mango

First I need to locate the specific line, I tried:

Qt Code:
  1. if(vectorData[ii].contains("Banana\0Apple")) // Do something
To copy to clipboard, switch view to plain text mode 

but didn't work.
Qt Code:
  1. "Banana\nApple"
To copy to clipboard, switch view to plain text mode 
and
Qt Code:
  1. "Banana\n\rApple"
To copy to clipboard, switch view to plain text mode 
neither. I can't use readAll() because the rest of the code breaks down. Must be taken into account every time I read the text, all the lines are in different position (the textfile is randomly modified). Thanks, I'm super newbie.