741
社区成员
发帖
与我相关
我的任务
分享
Private Sub Command1_Click()
Dim s As String
Dim i As Long
Dim j As Long
Dim L As Long
s = "<N>我</N> <V>是</V> 一只 <N>鱼</N>"
i = 1
j = 0
L = Len(s)
For i = 1 To L
If i > 2 Then
If Mid(s, i, 1) = ">" And Mid(s, i - 2, 1) = "<" And (Mid(s, i - 1, 1) = "N" Or Mid(s, i - 1, 1) = "V") Then j = i + 1
End If
If j > 0 And Mid(s, i, 2) = "</" Then Debug.Print Mid(s, j, i - j): j = 0
Next
End Sub