Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string s = "";
- int l = 0;
- var sb = new StringBuilder();
- for (int r = 0; r < s.Length + 1; r++)
- {
- if (r < s.Length)
- {
- if (s[r] == '<')
- {
- l = 0;
- }
- else if (s[l] == '<' && s[r] == '>')
- {
- string tag = s.Substring(l, r - l + 1);
- if (!IsKnownTag(tag))
- {
- sb.Append(tag);
- }
- l = r + 1;
- }
- else if (s[l] != '<')
- {
- sb.Append(s[r]);
- }
- }
- else if (s[l] == '<')
- {
- sb.Append(s.Substring(l, r - l));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement