I need to store HTML in one of the varibles in my class, which datatype would you suggest? Will string be ok or is there any special datatype I can use for this kind of operation.
string
if you're storing the raw HTML.
If you were planning on storing an object-representation of the HTML, then obviously you would use that object.
However, if it's just the raw HTML string, you'd use a string
. There's nothing specially suited to any type of string content.
Actually, there kindof is, but it has a specialist usage to represent already-encoded HTML data that should not be encoded again (generally used to output raw HTML in ASP.NET). This isn't what you want, but just so that this answer is complete - HtmlString
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With