Truncate text inside a string with HTML tags

0

I have a string column in the database that stores a message. This message is an email, it is in html because when it is rendered by the browser the text can have different styles (size, color, etc ...). How can I count the number of characters in C #, ignoring the tags, and truncating when they reach a certain number. Is it possible to do it? What if I get an unfinished HTML tag? I probably will not use this logic in production, but I was curious. Thank you.

    
asked by anonymous 16.02.2018 / 19:32

0 answers