Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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

var example = "I am too long string";
var result;

// Slice is JS function
result = example.slice(0, 10)+'...'; //if you need dots after the string you can add
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #output #length #string #javascript
ADD COMMENT
Topic
Name
1+4 =