Alright, here's kind of a tough problem. Let's say I've got a lengthy string that contains HTML. Let's say that I want to get the first 400 letters from the string. But the tricky thing is doing that without splitting HTML tags in half. Also, if there's an element still open at the end, it needs to be closed. For example:
That would be a bad thing. This is also a possible problem:
A <b> tag is opened, but it isn't closed. Does anyone know how to get around these problems? Thanks, I appreciate any help!