分享

通用截取函数

 zele 2011-05-21

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 = "<html><title>this is title</title></html>"
hunzi2 = strCut(hunzi1, "<title>", "</title>")
MsgBox hunzi2
End Sub

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多