vb比较两个数组,输出不同的数据?
以下是输出相同的,我要的是输出不同的值。Functionf(AAsString,BAsString)AsIntegerDims()AsString,I%,J%Dimy()...
以下是输出相同的,我要的是输出不同的值。Function f(A As String, B As String) As IntegerDim s() As String, I%, J%Dim y() As StringDim ss As StringText3.Text = ""s = Split(A, " ")y = Split(B, " ")For I = 0 To UBound(s)For J = 0 To UBound(y)If Val(s(I)) = Val(y(J)) Thenss = ss & " " & s(I)GoTo hEnd IfNext Jh: Next IText3.Text = ssEnd Function
展开
1个回答
展开全部
Function f(A As String, B As String) As Integer
Dim s() As String, I%, J%
Dim y() As String
Dim ss As String
Text3.Text = ""
s = Split(A, " ")
y = Split(B, " ")
For I = 0 To UBound(s)
For J = 0 To UBound(y)
If Val(s(I)) = Val(y(J)) Then Exit For
Next J
If J > UBound(y) Then ss = ss & " " & s(I)
Next I
Text3.Text = ss
End Function
Dim s() As String, I%, J%
Dim y() As String
Dim ss As String
Text3.Text = ""
s = Split(A, " ")
y = Split(B, " ")
For I = 0 To UBound(s)
For J = 0 To UBound(y)
If Val(s(I)) = Val(y(J)) Then Exit For
Next J
If J > UBound(y) Then ss = ss & " " & s(I)
Next I
Text3.Text = ss
End Function
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询