Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript truncate string

var string = "ABCDEFG";
var truncString = string.substring(0, 3); //Only keep the first 3 characters
console.log(truncString); //output: "ABC"
 
PREVIOUS NEXT
Tagged: #javascript #truncate #string
ADD COMMENT
Topic
Name
6+7 =