Good day,
If I understood correctly, you want to remove the "<value></value>" tag from within the text.
Using your Function DeleteBetween1(...), you will need to change the Regular Expression pattern to include both tags and whatever is in between.
string regularExpressionPattern1 = "<value>.*</value>";
That should look for any text matching your criteria
You would also need to change your RegexOptions to either None, or Multiline
Regex regex = new Regex(regularExpressionPattern1, RegexOptions.None | RegexOptions.Multiline);
That should find all occurrences of your criteria in the text.
For the replacement part you only need to execute this inside the loop for each Match
STR = STR.Replace(m.Value, "");
Hope it solves your issue.
Complete Code :
public static string DeleteBetween1(string STR, string FirstString, string LastString)
{
string regularExpressionPattern1 = "<value>.*</value>";
Regex regex = new Regex(regularExpressionPattern1, RegexOptions.None | RegexOptions.Multiline);
MatchCollection collection = regex.Matches(STR.ToString());
foreach (Match m in collection)
{
STR = STR.Replace(m.Value, "");
}
return STR;
}