Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用vb.net提取部分段落_Vb.net_String - Fatal编程技术网

使用vb.net提取部分段落

使用vb.net提取部分段落,vb.net,string,Vb.net,String,我有以下一段: 免费每日星象由findyourfate。comhttp://www.findyourfate.comThings 你需要学会如何接受这个事实。虽然这听起来像是轻率或讽刺的建议,但事实是,最近,每当命运在你的道路上撒下几片玫瑰花瓣,你就会选择把它们看作更多的碎片——如果你真的选择看到它们的话。醒醒,醒醒。你需要开始承认这些礼物是送给你的礼物。你需要明白你是多么值得他们。[退货报告] 我使用vb.net将其存储在字符串中 如何拆分该字符串以仅输出以下部分: 事情是好的,而且越来越好—

我有以下一段:

免费每日星象由findyourfate。comhttp://www.findyourfate.comThings 你需要学会如何接受这个事实。虽然这听起来像是轻率或讽刺的建议,但事实是,最近,每当命运在你的道路上撒下几片玫瑰花瓣,你就会选择把它们看作更多的碎片——如果你真的选择看到它们的话。醒醒,醒醒。你需要开始承认这些礼物是送给你的礼物。你需要明白你是多么值得他们。[退货报告]

我使用vb.net将其存储在字符串中

如何拆分该字符串以仅输出以下部分:


事情是好的,而且越来越好——你需要学会如何接受这个事实。虽然这听起来像是轻率或讽刺的建议,但事实是,最近,每当命运在你的道路上撒下几片玫瑰花瓣,你就会选择把它们看作更多的碎片——如果你真的选择看到它们的话。醒醒,醒醒。你需要开始承认这些礼物是送给你的礼物。你需要明白你是多么值得他们。

如果你有相同的段落,每次你需要得到相同的输出,你可以使用替换而不是拆分,这样更容易:

 Dim texts As String = "Free Daily Horoscope by findyourfate.comhttp://www.findyourfate.comThings are good and getting better -- and you need to learn how to accept this fact. While this may sound like flippant or sarcastic advice, the truth is that lately, whenever the fates have thrown a few rose petals in your path, you have chosen to see them as just more debris -- if you have elected to see them at all. Wake up and wise up. You need to start acknowledging the gifts as gifts meant for you. You need to understand just how worthy of them you are.http://www.findyourfate.com/rss/dailyhoroscope-feed.asp?sign=Aries [return delivery report]"

    texts = texts.Replace("Free Daily Horoscope by findyourfate.comhttp://www.findyourfate.com", "")

    texts = texts.Replace("http://www.findyourfate.com/rss/dailyhoroscope-feed.asp?sign=Aries [return delivery report]", "")
你会得到同样的结果,当然,如果你一直

如果您希望使用拆分:

Dim arraytext() As String

    arraytext = Split(texts, "Free Daily Horoscope by findyourfate.comhttp://www.findyourfate.com")

    arraytext = Split(arraytext(1), "http://www.findyourfate.com/rss/dailyhoroscope-feed.asp?sign=Aries [return delivery report]")

MsgBox(arraytext(0))