/ Published in: C#

[Credit - Sam Allen, Dot Net Perls](http://dotnetperls.com/remove-html-tags)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public static string StripXML(string source) { int bufferIndex = 0; bool inside = false; for (int i = 0; i < source.Length; i++) { char let = source[i]; if (let == '<') { inside = true; continue; } if (let == '>') { inside = false; continue; } if (!inside) { buffer[bufferIndex] = let; bufferIndex++; } } }
Comments
