I have a long string and within that string I have the following text:
\"formatter\": \"SomeInformationHere\"
I need to fi
Use this:
string longString = @"""formatter"": ""SomeInformationHere""";
string pattern = "(\"formatter\": )([\"])(.*)([\"])";
string result = Regex.Replace(longString, pattern, "$1$3");
This replaces all found matches with the second and the fourth sub group of the match. The complete match is the first sub group ($0
) and all parts in parenthesis create a new sub group.