Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to output only a certain length of a string in javascript

var str = 'Some very long string';
if(str.length > 10) str = str.substring(0,10);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #output #length #string #javascript
ADD COMMENT
Topic
Name
7+7 =