是个文本这里的内容大概在2M但是太多无用的内容:我想用VB去掉无用的内容无用的内容前的符号是:|/">多有这个特征:我想吧|/">前的内容全去掉结束的内容
意思就是去掉前面的内容|/">结束
希望牛B的高手给我详细代码
VB提起TXT指定符号后的内容
答案:2 悬赏:0 手机版
解决时间 2021-01-02 19:40
- 提问者网友:献世佛
- 2021-01-02 11:55
最佳答案
- 五星知识达人网友:神的生死簿
- 2021-01-02 12:43
Private Sub Command1_Click()
Text1.Text = DeleteStr(Text1.Text, "")
End Sub
Private Function DeleteStr(strSearch As String, strStart As String, strEnd As String) As String
Dim intStart As Long, intEnd As Long
Dim strMid As String
While 1
intStart = InStr(1, strSearch, strStart)
intEnd = InStr(1, strSearch, strEnd)
If intStart = 0 Or intEnd = 0 Then GoTo ExitH
strMid = Mid(strSearch, intStart, intEnd - intStart + 1 + Len(strStart) - 2 + Len(strEnd) - 2)
strSearch = Replace(strSearch, strMid, "")
Wend
ExitH:
DeleteStr = strSearch
End Function
Text1.Text = DeleteStr(Text1.Text, "")
End Sub
Private Function DeleteStr(strSearch As String, strStart As String, strEnd As String) As String
Dim intStart As Long, intEnd As Long
Dim strMid As String
While 1
intStart = InStr(1, strSearch, strStart)
intEnd = InStr(1, strSearch, strEnd)
If intStart = 0 Or intEnd = 0 Then GoTo ExitH
strMid = Mid(strSearch, intStart, intEnd - intStart + 1 + Len(strStart) - 2 + Len(strEnd) - 2)
strSearch = Replace(strSearch, strMid, "")
Wend
ExitH:
DeleteStr = strSearch
End Function
全部回答
- 1楼网友:掌灯师
- 2021-01-02 13:26
如果里面只有数字的话,直接用正则表达式
您的例如:“坐标(123,456)”中
就可以用表达式:\d{3}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯