I have a string like this:
Hello world!<br />this is a new day for us<br /><br />lorem ipsum dolor and more long string here
and I need to only show the first 15 characters.. how do I do that? if possible I want to use only vanilla js (no jquery)
I thought of these steps:
get rid of the html tags
use substr to truncate the string
but some people says that using regex myString.replace(/<[^>]*>?/gm, ''); in javascript to strip html tags is not 100% dependable.. (link here) so now I don't know what to do. any help is appreciated