Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,111 questions

40,781 answers

573 users

How to remove element from Hashtable by key in C#

Learn & Practice SQL


79 views
asked May 10, 2020 by avibootz
edited May 10, 2020 by avibootz

1 Answer

0 votes
using System;
using System.Collections; 
                      
public class Program
{
    public static void Main()
    {
 		Hashtable ht = new Hashtable(); 
  
        ht.Add("c", "c#"); 
        ht.Add("a", "c++"); 
        ht.Add("d", "java"); 
        ht.Add("e", "c");         
		ht.Add("b", "php"); 
		
		ht.Remove("d"); 
  
        foreach(DictionaryEntry de in ht) { 
            Console.WriteLine("{0}: {1} ", de.Key, de.Value); 
        } 
    }
}
  

  
/*
run:
  
a: c++ 
b: php 
c: c# 
e: c
  
*/

 





answered May 10, 2020 by avibootz

Related questions

1 answer 71 views
1 answer 80 views
80 views asked Feb 20, 2017 by avibootz
1 answer 84 views
2 answers 124 views
1 answer 79 views
...