There are two issues with your solution.
Behavior of ToString()
When doing .ToString() on an IEnumerable it will always print out the type. This is due to the fact that IEnumerable does not override the behavior of ToString(). See ToString for more info on this.
If you'd like to convert an IEnumerable<char> (the return type of Except) to a string, you'll have to do
var C = new string(A.Except(B));
Behavior of A.Except(B)
The Except method doesn't quite work the way you think it does.
Take for example the following code:
var a = new List<int> { 1, 2, 3 };
var b = new List<int> { 2, 3, 4 };
var c = a.Except(b);
The result of this would be { 1 }. What the method effectively does is return a new enumeration of all ints that are present in a, but not in b.
Now, strings are just an enumeration of chars - more precisely, your
var A = "<div><p>One</p><p>Two</p></div>";
from LINQ's perspective, is equivalent to
var A = new List<char> { '<', 'd', 'i', 'v', '>', ..., '<', '/', 'd', 'i', 'v', '>' };
The same goes for B.
So, when you do A.Except(B), what LINQ will actually do is go through each character and see if it can find it in B. If it does, it does not end up in the result set. Now, since all the chars in A are also present in B, you'll get an empty string. To see that this is actually the case, slightly modify A so it contains a character that is not in B:
string A = "<div><p>One</p><p>Two</p></div>ApplePie";
If you now do
string A = "<div><p>One</p><p>Two</p></div>ApplePie";
string B = "<div><p>One</p><p>Two</p><p>Three</p></div>";
string C = new string(A.Except(B).ToArray());
what you'll get is "AlP".
Solution
In my opinion, the best way to do your except is to parse your strings, transform them into objects, and then doing the Except. No built-in algorithm has the ability to tell that your strings are actually structured and how to differentiate among them. And as a working solution, using HtmlAgilityPack (a nuget package)
var docB = new HtmlDocument();
docB.LoadHtml(B);
var docA = new HtmlDocument();
docA.LoadHtml(A);
var nodes = docB.DocumentNode.FirstChild.Descendants("p").Select(node => node.InnerHtml)
.Except(docA.DocumentNode.FirstChild.ChildNodes.Select(node => node.InnerHtml));
// take note that we are actually doing whatIsInB.Except(whatIsInA), since doing the reverse would result in nothing. There is no <p> in A that is not also present in B
var result = string.Join(Environment.NewLine, nodes); // will resut in "Three"
var otherResult = $"<p>{result}</p>"; // "<p>Three</p>"
I'll let you make a more general approach :)
But the idea is that if you want except to work the way you expect it, you'll have to ask it to work with strings, not chars.
Whether you do the parsing required to extract the components of your string (the <p> elements in this example) using HtmlAgilityPack or Regex, as suggested in other solutions, is entirely up to you.
Three
` from the two strings. You will need to think about this first, perhaps with pencil and paper. – Klaus Gütter Jan 10 '19 at 14:47One
"`,`"Two
"`, and so on. **Guillermo Gutiérrez** gives you the basics for that. – Ann L. Jan 10 '19 at 15:10