I have the following piece of code which opens a text file and reads all the lines in the file and storing it into a string array.
Which then checks if
You can try this:
First you need to create a method that receives an array of type string, then we convert that array to a string, then we read all the text from the txt and we can use (Contains) to know if the text we send exists in our txt and we validate if that is truth or false, I hope it helps you.
public static void TextValidation(string[] val){
//Path of your file
string path = "/Users/Desktop/YourFile.txt";
//Array to string
string b = string.Join(",",val);
//Validate if exists
if(File.ReadAllText(path).Contains(b)){
Console.WriteLine("found");
// Do something if the data is found
}else{
Console.WriteLine("Not found");
}
}