string - Deleting substrings "dynamically" from a line in C# -


i have file lines in text file this

this test value {mytestvalue = 0.34} how delete test value? line has {mysecondtestvalue = 0.35} 

the value of mytestvalue not same value in each line.

is there way determine number of chars till closing parenthesis , delete within parentheses. output like:

this test value {}  how delete test value? line has {mysecondtestvalue = 0.35} 

possible implementation via regular expressions:

string source = "this test value {mytestvalue = 0.34} how delete test value?";  string result = regex.replace(source, "{.*}", (matchevaluator) ((match) => "{}")); 

Comments