How to get HashSet size in C#

1 Answer

0 votes
using System;
using System.Collections.Generic;
  
public class Program
{
    public static void Main(string[] args)
    {
        HashSet<string> hset = new HashSet<string> {"c#", "vb.net", "c", "c++", "python"};
  
        Console.WriteLine(hset.Count);   
    }
}
  
  
  
  
/*
run:
    
5
    
*/

 



answered Feb 7, 2024 by avibootz

Related questions

1 answer 132 views
132 views asked Oct 30, 2022 by avibootz
1 answer 132 views
132 views asked Feb 16, 2021 by avibootz
1 answer 180 views
180 views asked Sep 26, 2016 by avibootz
1 answer 114 views
114 views asked Mar 9, 2023 by avibootz
1 answer 136 views
136 views asked Jul 18, 2022 by avibootz
2 answers 152 views
...