Search code examples
asp.nethtmlcssvisual-studio-2010visual-web-developer-2010

Automatically escape <'s and >'s


I want to show text on a web page without having to remember to go over it and check if there are any <'s and >'s in it, so simply copying the text from, say, notepad to visual studio isn’t good.

So I tried "paste alternate" but it adds line breaks, and keeps the original fonts etc. All I want is the text itself.

Is there an automatic way - via CSS or Visual Studio perhaps?


Solution

  • Regex search+replace: s/</&lt;/ and s/>/&gt;/