VB如何去除含有某些字符的项目。
发布网友
发布时间:2023-08-05 18:30
我来回答
共2个回答
热心网友
时间:2024-11-22 21:18
看题意,就是去掉字符串两边的的两个英文标点留下中间的字符串内容吗?这个简单有效的就是下面这一句就搞定了,不需要复杂的代码:
假设字符串存在Str中,那么:
Str=Mid(Str,2,Len(Str)-2)
就OK啦,简单实用。
热心网友
时间:2024-11-22 21:18
Private Sub Command1_Click()
MMM List1, List1, "qq"
MMM List1, List1, "msn"
End Sub
Private Sub MMM(inList As ListBox, outList As ListBox, xStr As String)
Dim i, AAA As String, TmpFiel() As String
For i = 0 To inList.ListCount - 1
If InStr(inList.List(i), xStr) = 0 Then AAA = AAA & inList.List(i) & vbCrLf
Next i
TmpFiel() = Split(AAA, vbCrLf)
outList.Clear
For i = 0 To UBound(TmpFiel)
outList.AddItem TmpFiel(i)
Next i
End Sub