How to escape < and > inside pre tags with HTML?

Spread the love

To escape < and > inside pre tags with HTML, we use HTML entities.

For instance, we write

<pre>
    PrimeCalc calc = new PrimeCalc();
    Func&lt;int, int&gt; del = calc.GetNextPrime;
</pre>

to replace < with < and replace > with >.

Leave a Reply

Your email address will not be published. Required fields are marked *