Possible Duplicate:
Is it better to call ToList() or ToArray() in LINQ queries?
Hi,
I have following code
static void Main(string[] args)
{
const string FileName = @"c:\words";
HashSet<string> wordLookup = new HashSet<string>(File.ReadAllLines(FileName), StringComparer.InvariantCultureIgnoreCase);
List<string> wordList1 = wordLookup.ToList();
string[] wordList2 = wordLookup.ToArray();
}
Could any one please tell which one is faster
List<string> wordList1 = wordLookup.ToList();
or
string[] wordList2 = wordLookup.ToArray();