我需要一個用于字節(jié)數(shù)組的HashSet,以便檢查集合中是否存在給定的字節(jié)數(shù)組。但似乎這不適用于字節(jié)數(shù)組(或任何數(shù)組)。這是我的測試代碼:void test(){ byte[] b1 = new byte[] { 1, 2, 3 }; byte[] b2 = new byte[] { 1, 2, 3 }; HashSet<byte[]> set = new HashSet<byte[]>(); set.Add(b1); set.Add(b2); Text = set.Count.ToString();//returns 2 instead of the expected 1.}有沒有一種方法可以為字節(jié)數(shù)組創(chuàng)建HashSet?
- 1 回答
- 0 關(guān)注
- 228 瀏覽
添加回答
舉報
0/150
提交
取消