Count symbol occurence where string is before symbol

Hi guys,
I want to know on which occurence of a symbol does a certain string appear before it. For example:
User>
Id>
Address>
E-mail>
I manged to find the number of occurences for “>“using system.Text.RegularExpressions.Regex.Matches(str,”>”).Count => 4
But I need to know on which occurence it has “Address” before it (no 3 in this case).
Any ideas please?

Thanks !

Figured it out, regex it with matches and iterate through it using the result from system.Text.RegularExpressions.Regex.Matches(str,”>”) as the times the matches result should be checked until NeededString.equals(MatchesResult(counter).toString).

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.