截取特定头部及尾部标签内匹配的内容函数,通常用于小偷程序。
Public Function CutFixContent(ByVal str, ByVal start, ByVal last, ByVal n)
Dim strTemp
On Error Resume Next
If InStr(str, start) > 0 Then
Select Case n
Case 0 '左右都截取(都取前面)(去处关键字)
strTemp = Right(str, Len(str) - InStr(str, start) - Len(start) + 1)
strTemp = Left(strTemp, InStr(strTemp, last) - 1)
Case Else '左右都截取(都取前面)(保留关键字)
strTemp = Right(str, Len(str) - InStr(str, start) + 1)
strTemp = Left(strTemp, InStr(strTemp, last) + Len(last) - 1)
End Select
Else
strTemp = ""
End If
CutFixContent = strTemp
End Function