OrderedDictionary.RemoveAt メソッド
アセンブリ: System (system.dll 内)




OrderedDictionary コレクションの変更方法を示すコード例を次に示します。この例では、RemoveAt メソッドと Count プロパティを使用して、OrderedDictionary の最後のエントリを削除します。このコードは、OrderedDictionary で参照できるコード例の一部です。
' Modifying the OrderedDictionary If Not myOrderedDictionary.IsReadOnly Then ' Insert a new key to the beginning of the OrderedDictionary myOrderedDictionary.Insert(0, "insertedKey1", "insertedValue1") ' Modify the value of the entry with the key "testKey2" myOrderedDictionary("testKey2") = "modifiedValue" ' Remove the last entry from the OrderedDictionary: "testKey3" myOrderedDictionary.RemoveAt(myOrderedDictionary.Count - 1) ' Remove the "keyToDelete" entry, if it exists If (myOrderedDictionary.Contains("keyToDelete")) Then myOrderedDictionary.Remove("keyToDelete") End If End If
// Modifying the OrderedDictionary if (!myOrderedDictionary.IsReadOnly) { // Insert a new key to the beginning of the OrderedDictionary myOrderedDictionary.Insert(0, "insertedKey1", "insertedValue1"); // Modify the value of the entry with the key "testKey2" myOrderedDictionary["testKey2"] = "modifiedValue"; // Remove the last entry from the OrderedDictionary: "testKey3" myOrderedDictionary.RemoveAt(myOrderedDictionary.Count - 1); // Remove the "keyToDelete" entry, if it exists if (myOrderedDictionary.Contains("keyToDelete")) { myOrderedDictionary.Remove("keyToDelete"); } }

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


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

- OrderedDictionary.RemoveAt メソッドのページへのリンク