How do I escape characters in C# comments?
c#
Solution
If you need to escape characters in XML comments, you need to use the character entities, so `<` would need to be escaped as `<`, as in your question.
The alternative to escaping is using `CDATA` sections, to the same effect.
As you noted, this would produce good looking documentation, but a horrible comment to read...
Problem
I realized today that I don't know how to escape characters in comments for C#. I want to document a generic C# class, but I cannot write a proper example since I don't know how to escape the `<` and `>` characters. Do I have to use `<` and `>`? I don't like if that is the case since I want to make it easy to read the comment in the actual document so I don't have to generate some kind of code document to be able to read the example code.