First off, I didn’t not write this code. I might have modified it but I’m not sure since I’ve had it around for quite some time.
If you’re the creator, thanks! It’s been handy. And comment and I’ll add a “credit-link” in this post. 😉
The code to get the value, text or string or whatever you choose to call it is so easy to use, short and it’s handy in many different kind of applications.
If you’re writing a Scraper in VB.net, this is a perfect Function that surely will be useful for you.
Lets say you have a string with the following content:
"Erik Johan Jonas Johanna Martin David"
And you want to pick out the name between Johanna and David:
Dim FindIt As String = GetBetween(Haystack, "Johanna", "David")
So, I used Dim in the same line to set up a string to store the text we’re picking out and then used the function called GetBetween to extract the text.
There will be spaces that you might want to use Trim on since I didn’t include the space as a prefix and suffix when using the GetBetween function.
The code is in the full post. Follow the link!