Dictionary.System.Collections.IDictionary.Remove メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Private Sub System.Collections.IDictionary.Remove ( _ key As Object _ ) Implements IDictionary.Remove
Dim instance As Dictionary(Of TKey, TValue) Dim key As Object CType(instance, IDictionary).Remove(key)
private: virtual void System.Collections.IDictionary.Remove ( Object^ key ) sealed = IDictionary::Remove



Dictionary で System.Collections.IDictionary インターフェイスの System.Collections.IDictionary.Remove を使用する方法を次のコード例に示します。
次のコード例は、System.Collections.IDictionary.Add メソッドのトピックで取り上げている例および出力の一部分です。
Imports System Imports System.Collections Imports System.Collections.Generic Public Class Example Public Shared Sub Main() ' Create a new dictionary of strings, with string keys, ' and access it using the IDictionary interface. ' Dim openWith As IDictionary = _ New Dictionary(Of String, String) ' Add some elements to the dictionary. There are no ' duplicate keys, but some of the values are duplicates. ' IDictionary.Add throws an exception if incorrect types ' are supplied for key or value. openWith.Add("txt", "notepad.exe") openWith.Add("bmp", "paint.exe") openWith.Add("dib", "paint.exe") openWith.Add("rtf", "wordpad.exe") <br /><span space="preserve">...</span><br /> ' Use the Remove method to remove a key/value pair. No ' exception is thrown if the wrong data type is supplied. Console.WriteLine(vbLf + "Remove(""dib"")") openWith.Remove("dib") If Not openWith.Contains("dib") Then Console.WriteLine("Key ""dib"" is not found.") End If <br /><span space="preserve">...</span><br /> End Sub End Class
using System; using System.Collections; using System.Collections.Generic; public class Example { public static void Main() { // Create a new dictionary of strings, with string keys, // and access it using the IDictionary interface. // IDictionary openWith = new Dictionary<string, string>(); // Add some elements to the dictionary. There are no // duplicate keys, but some of the values are duplicates. // IDictionary.Add throws an exception if incorrect types // are supplied for key or value. openWith.Add("txt", "notepad.exe"); openWith.Add("bmp", "paint.exe"); openWith.Add("dib", "paint.exe"); openWith.Add("rtf", "wordpad.exe"); <br /><span space="preserve">...</span><br /> // Use the Remove method to remove a key/value pair. No // exception is thrown if the wrong data type is supplied. Console.WriteLine("\nRemove(\"dib\")"); openWith.Remove("dib"); if (!openWith.Contains("dib")) { Console.WriteLine("Key \"dib\" is not found."); } <br /><span space="preserve">...</span><br /> } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDictionary.System.Collections.IDictionary.Remove メソッドを検索する場合は、下記のリンクをクリックしてください。

- Dictionary.System.Collections.IDictionary.Remove メソッドのページへのリンク