javascript string character limit code example
Example 1: js string limit length
string.substring(0,lengthRequired+1);
Example 2: limit characters display javascript
var str = 'Some very long string';
if(str.length > 10) str = str.substring(0,10);