I want to delete the output between the value tags but am falling to do so. i only want to delete the value tag that is within the data which is my table. can you please help me delete those values. keep it in mind that those output are not hard-coded,the user just entered those values, so every time i load the form i want to delete those output between the tags.
<data name="CurrentSelectedUser_Label" xml:space="preserve">
<value>Current selected record:</value>
<comment>[Font]Bold[/Font][DateStamp]2015/01/01 00:00:00[/DateStamp][Comment] this is a comment.!![/Comment]</comment>
</data>
<data name="FinEnrolment_Exit_Button" xml:space="preserve">
<value>Exit Finger Enrolment</value>
<comment>[Font]Regular[/Font][DateStamp]2014/012/01 00:00:00[/DateStamp][Comment] this is a comment.!![/Comment]</comment>
</data>
i tried this, but am failing to specify the value tags that are within the data which is my table. see my coding below;
string text = File.ReadAllText(outputFilePath);
text = DeleteBetween1(text, "<value>", "</value>");
public string DeleteBetween1(string STR, string FirstString, string LastString)
{
string regularExpressionPattern1 = "<value(.*?)>";
Regex regex = new Regex(regularExpressionPattern1, RegexOptions.Singleline);
MatchCollection collection = regex.Matches(STR.ToString());
var val = string.Empty;
foreach (Match m in collection)
{
val = m.Groups[1].Value;
STR = STR.Replace(val, "");
}
STR = STR.Replace(val, "");
return STR;
}