示例:
[按钮单击]两个指定的字符串(<title>[...]</title>
)Msgbox(未指定字符串的名称(两个标题标签之间的字符串))
因为标签之间的字符串是可变的,所以我不能使用(if textbox1.contains("EXAMPLE") = true Then
[...])
根据@Jimi的评论
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim s = "<title>Hello World</title>"
Dim startIndex = s.IndexOf(">") + 1
Dim stringLength = s.LastIndexOf("<") - startIndex
Dim titleText = s.Substring(startIndex, stringLength)
Debug.Print(titleText)
End Sub
立即显示窗口
Hello World