[英]VB.net Searching for a string HTML And Substring
如何在网络上的html文档中找到Color Of The Day:
? 然后像这样找到文本:
Color Of The Day: Blue
HTML(裁剪行)如下所示:
<li><strong>Color Of The Day: Blue</strong></li>
Web的源代码上下有很多行。
我正在寻找一种将Blue
放入MsgBox(color)
谢谢阅读。
首先将整个字符串按正常方式读入变量。 然后,使用“替换”功能去除不需要的零件。
例:
假设您读入并保存了字符串
“当天的颜色:蓝色”到名为withParts的变量
Dim withoutParts As String = Replace(withParts, "Color Of The Day: ", "")
这将用任何内容替换短语“ Color Of The Day:”,实际上是在没有Parts的新变量中为您提供了新字符串“ Blue”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.