How do I write the values of a hashset
to the console? I do not want to use a foreach
loop.
HashSet<string> hashSet=new HashSet<string>();
hashSet.Add("Employee");
hashSet.Add("Employee1");
Console.WriteLine(hashSet.Select(x=>x));
Output
System.Linq.Enumerable
Expected output
Employee,Employee1