I have a field which has a lot of content. I want to apply a logic where i would extract out content with 50 chars and will be aadded by (more..). However, i want to apply it in such a way that the content can be less than 50 chars but should involve all the full words. So that "This is a test" should not become This is a t(more..).
rather it should be
This is a (more...)
How do i achieve this in Jquery or javascript.
thanks