Smart way to truncate long strings
Does anyone have a more sophisticated solution/library for truncating strings with JavaScript and putting an ellipsis on the end, than the obvious one: if (string.length > 25) { string = string.substring(0, 24) + “…”; } 26 Answers 26