July 25th, 2004, 04:15 PM
Checking to make sure a TStringList doesn't contain any contents in a specific file
Hello . I would love to filter a TStringList so that none of its strings are anything in a text file. the text file contains line delimited strings that the TStringList should be filtered from . Can anyone suggest something please .
July 26th, 2004, 02:31 AM
Like I understand it:
You want one list with X elements, and another list (or file) with Y, and (X !Є Y)?
Lets call X your first list (not the file, and Y the file's list)
I have not tested this, but I think it'll work.
TStringList *Y = new TStringList;
for (int i = 0; i < Y->Count; i++)
if (X->IndexOf(Y->Strings[i]) >= 0) X->Delete(X->IndexOf(Y->Strings[i]));