vb System.Collections.Generic.SortedList<TKey,TValue>.IDictionary.Remove类(方法)实例源码

下面列出了vb System.Collections.Generic.SortedList<TKey,TValue>.IDictionary.Remove 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Collections.Generi   
' 导入命名空间
Imports System.Collections
Imports System.Collections.Generic

Public Class Example
    
    Public Shared Sub Main() 

        ' Create a new sorted list of strings, with string keys,
        ' and access it using the IDictionary interface.
        '
        Dim openWith As IDictionary = _
            New sortedList(Of String, String)
        
        ' Add some elements to the sorted list. 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")

作者:VB.NET开发    项目:System.Collections.Generi   
' 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

作者:VB.NET开发    项目:System.Collections.Generi   
End Sub

End Class


问题


面经


文章

微信
公众号

扫码关注公众号