How to show less content lines using jsom in sharepoint

Viewed 10
1 Answers

You can use the code like below to truncate the string variable:

function truncate(input, noOfChar) {
   if (input.length > noOfChar) {
      return input.substring(0, noOfChar) + '...';
   }
   return input;
};

Usage:

theString = truncate(theString, 100);
Related