CollectionsUtil.CreateCaseInsensitiveSortedList : CollectionsUtil « System.Collections.Specialized « VB.Net by API






CollectionsUtil.CreateCaseInsensitiveSortedList

  
 

Imports System.Collections.Specialized
Imports System.Collections

public class Test
  
   public Shared Sub Main
        Dim sorted_list As SortedList

        ' Use a normal, case-sensitive SortedList.
        sorted_list = New SortedList
        sorted_list.Add("Sport", "Volleyball")
        sorted_list.Add("sport", "Golf")        ' Okay because Sport <> sport.

        ' Use a case-insensitive SortedList.
        sorted_list = CollectionsUtil.CreateCaseInsensitiveSortedList()
        sorted_list.Add("Sport", "Volleyball")
        sorted_list.Add("sport", "Golf")        ' Error because Sport = sport.
   End Sub
   
End class

   
    
  








Related examples in the same category