In need to develope page like below
[1]: https://i.stack.imgur.com/HpOnU.png`enter code here`if(theString.length>100){ theString = theString.substr(0,100)+'...'; }
In need to develope page like below
[1]: https://i.stack.imgur.com/HpOnU.png`enter code here`if(theString.length>100){ theString = theString.substr(0,100)+'...'; }
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);