How do i loop over the text and Get the text between the tags using indexof and substring...

  • Thread starter Thread starter Chocolade1972
  • Start date Start date
C

Chocolade1972

Guest
private void GetT()
{
int index = 0;
string ImagesDateTimeFirstTag = "msg-date";
string ImagesDateTimeEndTag = "</div>";
string[] files = Directory.GetFiles(combinedDir);
for (int i = 0; i < files.Length; i++)
{
string file = File.ReadAllText(files);
for (int x = 0; x < file.Length; x++)
{

int firstindex = file.IndexOf(DateTimeFirstTag, index);
int nextindex = file.IndexOf(DateTimeEndTag, firstindex);
string result = file.Substring(firstindex + 8, nextindex - firstindex);
}
}
}
What i want is to get the text in between the First and End tags using indexof and substring.

Continue reading...
 
Back
Top