Im working to correctly map links on websites.
I need to be able to count how often ../
occurs in a string. At this moment I have a function that loops through the string and counts, while this works, im looking for a Linq solution.
I know that I can count with a single character like this
int count = Href.Count(f => f == '/');
But, can I, by using LINQ
, count how often the pattern ../
occurs? Is this possible?