Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Substring in Javascript using substring

const str = "Learning to code";

// substring between index 2 and index 5
console.log(str.substring(2, 5));
// substring between index 0 and index 4
console.log(str.substring(0, 4));

// using substring() method without endIndex
console.log(str.substring(2));
console.log(str.substring(5));
Source by www.tutorialstonight.com #
 
PREVIOUS NEXT
Tagged: #Substring #Javascript #substring
ADD COMMENT
Topic
Name
5+2 =