This is the code:
if (@"d:\Keywords.txt".Contains(line))
{
}
else
{
w.WriteLine(line);
}
I see in notepad that in Keywords.txt there is the line:
Daniel
And line is now Daniel
But it still doing the w.WriteLine(line);
Why is that ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
"d:\Keywords.txt"is a string, so you are checking iflineis contained within"d:\Keywords.txt"string (it is not, that why it goes toelse). If you want to load contents of files then you can use (e.g.)File.ReadAllLines:Full list of
Fileclass methods are available @MSDN File Class