Advertisement
Guest User

Untitled

a guest
Jan 30th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3. class html
  4. {
  5. static void Main()
  6. {
  7. string html = "<html><head><title>News</title></head><body><p>textxtex</p></body>";
  8. int indexClosing = html.IndexOf('>');
  9. while (indexClosing>-1)
  10. {
  11. if (indexClosing<html.Length-1 && html[indexClosing+1]!='<')
  12. {
  13. int nextOpeningIndex = html.IndexOf('<', indexClosing);
  14. int textLength = nextOpeningIndex - indexClosing-1;
  15. Console.WriteLine(html.Substring(indexClosing+1,textLength));
  16. }
  17. indexClosing = html.IndexOf('>',indexClosing+1);
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement