.NET string contains string[]
- by Mike
I'm having a small issue putting together this contains statement any help would be awesome.
string betaFilePath = @"C:\resultsalpha.txt";
StringBuilder sb = new StringBuilder();
using (FileStream fs = new FileStream(betaFilePath, FileMode.Open))
using (StreamReader rdr = new StreamReader((fs)))
{
while (!rdr.EndOfStream)
{
string betaFileLine = rdr.ReadLine();
{
string[] onlythese = {@"apple/",@"aee/",@"www/",@"blk/",@"art/",@"purp/",@"ora/",@"red/",@"brd/",@"biek/",@"biz/"};
if (betaFileLine.Contains(onlythese))
{
File.AppendAllText(@"C:\testtestest.txt", betaFileLine);
}
}
}
Error: Argument '1': cannot convert from 'string[]' to 'string' - if (betaFileLine.Contains(onlythese))