达达和京东到家合并:通用截取函数

来源:百度文库 编辑:九乡新闻网 时间:2024/10/06 00:54:01

Function strCut(strContent, StrStart, StrEnd) As String '通用截取函数
  Dim strHtml, S1, S2 As String
  strHtml = strContent
  On Error Resume Next
   
  S1 = InStr(strHtml, StrStart) + Len(StrStart)
  S2 = InStr(S1, strHtml, StrEnd)
  strCut = Mid(strHtml, S1, S2 - S1)
   
End Function

Private Sub Form_Load()
Dim hunzi1, hunzi2 As String
hunzi1 = "this is title"
hunzi2 = strCut(hunzi1, "", "")
MsgBox hunzi2
End Sub