c# Checking if string is HtmlDecode
This isn't a language I know, but there appears to be a problem with the logic.

Suppose I have a simple statement:


  In XML, ampersand can be represented using '&amp;amp;' or '&amp;#38;'


Is that an already-encoded string?  The logic here says that it is, but we see that's not the case - the HTML version of that would be


  In XML, ampersand can be represented using '&amp;amp;amp;' or '&amp;amp;#38;'


If it's hard to keep track in code, a better option might be a small class to hold a HTML-encoded string, so that we don't confuse these with content strings (or vice-versa, if HTML-encoded is the default in your target environment).

But TBH, I think that good variable naming should be enough to track which strings are which.