用 Instr() 函数找到“<”,记录位置p1,从该位置继续查找“>”,记录位置p2,替换p1,p2之间的内容
p1=0
p2=1
Do
p1 = Instr(p2,Text1.Text,"<")
if p1 <= 0 then
exit sub ‘ 结束
else
p2 = Instr(p1,Text1.Text,">")
if p2<=0 then exit sub '原文格式错误
Mid(Text1.Text,p1,p2-p1+1) = "" '替换 为空
end if
loop
用vb打开这些txt,在text1里。然后用
Private Sub Command1_Click()
ip = 1
For i = 1 To Len(Text1.Text)
st = Mid(Text1.Text, i, 1)
If st = "<" Then ip = 0
If ip = 0 Then
w = w & st
End If
If ip = 1 Then
s = s & st
End If
If st = ">" Then
ip = 1
w = ""
End If
Next i
Text1.Text = s & w
End Sub