Archive for 六月, 2008

XOR運算

True xor True = False
True xor False = True
False xor True = True
False xor False = False

Continue reading »

Hashtable的索引鍵值有型別分別的

Hashtable的索引鍵值是有型別區分的,並不會替你自動轉型成字串,而是保留原先存入的物件型別.
例如:

Dim ht as New HashTable
ht(1)=0 : ht(‘1′) = 90
If ht.ContainsKey(1) Then
Console.WriteLine(“Result is {0}.”,ht(1).toString)
End If

則結果會是0,而不是90

Continue reading »