I have function for substring:
$('#text').on('mouseup', function(e){
var text = "There are a lot of text";
if (text != '') {
$('.ppr .sel_text').text(text.trim().substr(0,21) + "...");
}
});
How can I get only begining end ending of the text string?
For example, now result is "There are a lot of te...".
I would like to get: "There are ... text"