Answers for "javascript max length with elipsis"

3

javascript max length with elipsis

function truncate_with_ellipsis(s,maxLength) {
   if (s.length > maxLength) {
      return s.substring(0, maxLength) + '...';
   }
   return s;
};
alert(truncate_with_ellipsis("hello how are you today?",9));//hello how...
Posted by: Guest on September-10-2021

Code answers related to "javascript max length with elipsis"

Code answers related to "Javascript"

Browse Popular Code Answers by Language