I want to use the Split function on a string but keep the delimiting sequence as the first characters in each element of the string array. I am using this function to split HTML on every instance of a URL so I can run regex patterns on the URLs on a website. Is there any overloads of the split function to do this? or do I have to write my own function?
Thanks!
There is no built-in method for doing that. If you are splitting on a single pattern though, this can be coded out with the following
EDIT
Updated to not prefix every string 🙂