急急急急急急急急急急急急急急急!!!!!字符串模糊比较
不知道有没有方法可以判断001,002,003不是一类的,而像017A,017B,017C等等都判断是一类的,请教高人支招,谢谢!
[解决办法]
Like,支持通配符
示例:
a = "017a"b = "016c"If a Like "017*" Then MsgBox "a有017前缀"Else MsgBox "a没有017前缀"End IfIf b Like "017*" Then MsgBox "b有017前缀"Else MsgBox "b没有017前缀"End If
[解决办法]
Dim b As Boolean Dim t, i As Integer Dim s1 As String, s2 As String For Each t In Split("001,002,003,004,005,017a,017b,018,019a,019b", ",") b = False For i = 1 To Len(t) If Asc(Mid(t, i, 1)) > Asc(9) Then b = True: Exit For Next i If b Then s1 = s1 & " " & t Else s2 = s2 & " " & t Next t Dim t1, t2 t1 = Split(s1, " "): t2 = Split(s2, " ")
[解决办法]