Demonstrating method GetHashCode of class String

Started by thiruvasagamani, Jul 21, 2008, 07:35 PM

Previous topic - Next topic

thiruvasagamani

GetHashCode of class String

[color=#cd0000]Imports System

Public Class MainClass

   Shared Sub Main()
      Dim string1 As String = "hello"
      Dim string2 As String = "Hello"
      Dim quotes As Char = ChrW(34)

      Console.WriteLine( "The hash code for " & quotes & string1 & _
         quotes & " is " & string1.GetHashCode() )

      Console.WriteLine( "The hash code for " & quotes & string2 & _
         quotes & " is " & string2.GetHashCode() )
   End Sub ' Main

End Class
[/color]
Thiruvasakamani Karnan