Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

substr method

//substr() is similar to slice().
//The difference is that the second parameter specifies the length of the extracted part

let str = "Apple, Banana, Kiwi";
let part = str.substr(7, 6);

// >> Banana

//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #substr #method
ADD COMMENT
Topic
Name
1+9 =