Dim v1() As String = {"中国","美国","英国","俄罗斯"}
Dim s1 As New List(of String)
Dim s2 As New List(of String)
s1.AddRange(v1)
s2.AddRange(s1)
s2(2) = "法国"
Dim cou As Integer = s1.Count - 1
If s1.Count <> s2.Count Then
If s1.Count > s2.Count Then
cou = s2.Count - 1
msgbox("s1比s2多" & s1.Count - s2.Count & "个元素")
Else
msgbox("s2比s1多" & s2.Count - s1.Count & "个元素")
End If
End If
For i As Integer = 0 To cou
If s2(i) <> s1(i) Then
msgbox("第" & i+1 & "个元素值不同:" & vbcrlf & "s1:" & s1(i) & "s2:" & s2(i))
End If
Next