/ Published in: JavaScript
Expand |
Embed | Plain Text
function shortenString(string, maxlen, del) { string = string.toString(); if (!del) { del='...' } if (string.length > maxlen) { string = string.substr(0, maxlen) + del; } return string; } shortenString('some functions are just useful', 10)
You need to login to post a comment.
