vb字符串比较
发布网友
发布时间:2022-04-26 16:26
我来回答
共2个回答
热心网友
时间:2023-10-14 09:42
可能没有这样的函数,用下面的程序可以实现:
Private Sub Form_Load()
Dim A(1 To 7) As String, B(1 To 7) As String, C(1 To 7) As Integer
Dim X1 As String, X2 As String, Y1 As String, Y2 As String, T As Integer
STR1 = "1111234"
STR2 = "1112334"
For I = 1 To 7
X1 = Left(STR1, I)
X2 = Left(STR2, I)
X1 = Right(X1, 1)
X2 = Right(X2, 1)
A(I) = X1
B(I) = X2
Next I
For J = 1 To 7
If A(J) = B(J) Then
C(J) = 1
Else
C(J) = 0
End If
Next J
For I = 1 To 7
If C(I) = 0 Then
Label1.Caption = Label1.Caption & "第" & CStr(I) & "个:不相同; "
Else
Label1.Caption = Label1.Caption & "第" & CStr(I) & "个:相同; "
End If
Next I
End Sub
热心网友
时间:2023-10-14 09:43
据我所知,应该没有,不过你可以用循环来实现