I have written the below linq statement. But it takes huge time to process since there are so many lines. My cpu has 8 cores but only using 1 core due to running single thread.
So i wonder by any chance can this final stament run in multi threading ?
List<string> lstAllLines = File.ReadAllLines("AllLines.txt").ToList();
List<string> lstBannedWords = File.ReadAllLines("allBaddWords.txt").
Select(s => s.ToLowerInvariant()).
Distinct().ToList();
I am asking the one below. Can that line work multi threading ?
List<string> lstFoundBannedWords = lstBannedWords.Where(s => lstAllLines.
SelectMany(ls => ls.ToLowerInvariant().Split(' ')).
Contains(s)).
Distinct().ToList();
C# 5 , netframework 4.5