Linq not working in html tag removed StringI have a C# list in which one property has html string as below.
List<item> test = new List<item>;
test.Subject = "<div><externalclass=....><p>Original Text HERE</p></div>
I removed the html tags using the code
test[i].Subject = Regex.Replace(test[i]].Subject, @"<(.|\n)*?>", string.Empty)
After removal i have the property in list item as:
test.Subject="Original Text HERE"
Now am using linq to sort the subject by descending/ascending but the values are not sorting in the order. Am not sure why. Please help
var output = test.OrderByDescending(x=>x.Subject.Trim()).ToList();
Also tried the below
var output = test.OrderByDescending(x=>x.Subject.Trim()).Select(x=>x).ToList();
All other properties in the list are sorting properly but the property for which i removed html tags are not sorting. Could you please let me know what am missing