Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Truncate a string using javascript

var length = 3;
var myString = "ABCDEFG";
var myTruncatedString = myString.substring(0,length);
// The value of myTruncatedString is "ABC"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Truncate #string #javascript
ADD COMMENT
Topic
Name
1+4 =