如何将a的值写入hashset控制台?我不想使用foreach循环.
HashSet<string> hashSet=new HashSet<string>();
hashSet.Add("Employee");
hashSet.Add("Employee1");
Console.WriteLine(hashSet.Select(x=>x));
Run Code Online (Sandbox Code Playgroud)
产量
System.Linq.Enumerable
Run Code Online (Sandbox Code Playgroud)
预期产出
员工,Employee1