Option Explicit Private Sub Command1_Click() Dim s As String s = "asdfadesaddw3e" Dim strFind As String '要查找的子字符串 strFind = "<table" ' Dim a a = Split(s, strFind) MsgBox UBound(a) End Sub
代码如下:‘Replaces pattern with highlighted replacement (using style) and preserves case Public Function highlight(strText, strFind) Dim objRegExp, i, strHighlight ‘Split the search terms into an array Dim arrFind arrFind = Spli