Currently, I use:
Variabls:
int recordCount = 5;
Header = "Index"; // Can also be "Starting Index"
Header:
Header = Header.Split(' ')[0] + " (" + recordCount + ")";
Changes:
Index (5)
To:
Index (6)
When I want to replace the Header with a new Header, I use the above, but the problem is that when I start using more than one word in the Header it removes the rest of the Header Name. i.e. When it says Starting Index: it only shows Starting.
Can I use Regex to simply look for the value inbetween the parenthesis and replace it with another variable?
If you need to perform more complex replacements (i.e. if the replacement depends on captured value between the braces), you’ll have to stick with
Regex.MatchmethodUpdate: with
Matchthing quickly get ugly 🙂