Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js insert string at position

var a = "I want apple";
var b = " an";
var position = 6;
var output = [a.slice(0, position), b, a.slice(position)].join('');
console.log(output);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #insert #string #position
ADD COMMENT
Topic
Name
2+9 =