VB提起TXT指定符号后的内容
是个文本这里的内容大概在2M但是太多无用的内容:我想用VB去掉无用的内容无用的内容前的符号是:|/">多有这个特征:我想吧|/">前的内容全去掉结束的内容</a><br/...
是个文本这里的内容大概在2M但是太多无用的内容:我想用VB去掉无用的内容无用的内容前的符号是:|/">多有这个特征:我想吧|/">前的内容全去掉结束的内容</a><br /> 意思就是去掉前面的内容|/">结束</a><br />希望牛B的高手给我详细代码
展开
2个回答
2014-02-28
展开全部
Private Sub Command1_Click()
Text1.Text = DeleteStr(Text1.Text, "<a", ":/>")
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, "<a", ":/>")
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
2014-02-28
展开全部
如果是指符号的话 还有办法 如果是没规律的东西 就没 办法
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询