How to create string set in C#

1 Answer

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

 



answered Sep 3, 2023 by avibootz

Related questions

3 answers 108 views
1 answer 114 views
1 answer 94 views
1 answer 169 views
1 answer 138 views
1 answer 85 views
...