Option ExplicitPrivate Sub Command1_Click() MsgBox IsSame("1233") '如果相同就返回True 不重复返回False . '你自己一个一个的进行对比,相同就删除. End Sub Private Function IsSame(ByVal String1 As String) As Boolean Dim i As Long
IsSame = False
For i = 1 To Len(String1) - 1 If InStr(i + 1, String1, Mid(String1, i, 1)) > 0 Then IsSame = True Exit Function End If Next End Function
随手写的 没有调试过dim a ,b,c for i=listview1.listitem.count to 1 setp -1 a=mid(listview1.listitem(i).text,1,1) b=mid(listview1.listitem(i).text,2,1) c=mid(listview1.listitem(i).text,3,1) if a=b or a=c or b=c then listview1.listitem.remove i next
Option ExplicitPrivate Sub Command1_Click()
MsgBox IsSame("1233") '如果相同就返回True 不重复返回False .
'你自己一个一个的进行对比,相同就删除.
End Sub
Private Function IsSame(ByVal String1 As String) As Boolean
Dim i As Long
IsSame = False
For i = 1 To Len(String1) - 1
If InStr(i + 1, String1, Mid(String1, i, 1)) > 0 Then
IsSame = True
Exit Function
End If
Next
End Function
for i=listview1.listitem.count to 1 setp -1
a=mid(listview1.listitem(i).text,1,1)
b=mid(listview1.listitem(i).text,2,1)
c=mid(listview1.listitem(i).text,3,1)
if a=b or a=c or b=c then listview1.listitem.remove i
next