我有6個數組列表,我想知道哪一個是最長的,而不使用一堆IF語句。比較多個arraylist長度找到最長的一個
「if arraylistist.count> anotherlist.count Then ....」< - 反正這樣做不是這樣嗎?
在VB.net或C#.Net(4.0)中的例子會很有幫助。
arraylist1.count
arraylist2.count
arraylist3.count
arraylist4.count
arraylist5.count
arraylist6.count
DIM longest As integer = .... 'the longest arraylist should be stored in this variable.
感謝
vb.net or c#?.. – 2012-01-17 14:05:43
您使用的是什麼版本的.NET,什麼是* exact *類型? (示例代碼會很好...) – 2012-01-17 14:05:57
4.0。 c#.net或vb.net的例子很好 – tdjfdjdj 2012-01-17 14:06:54