Create GSwP- 23 of 28

console.log("January".substring(0 ,3) );
console.log("Melbourne is great".substring(0 ,12) );
console.log("Hamburgers".substring(3, 10) );


/*

Output produced is:

Jan
Melbourne is
burgers


Original text.


// Use console.log( ) to print out the substrings.
// Here is an example of the 1st to 4th letter of "JavaScript":
// console.log("JavaScript".substring(0,4));


From codeacademy.com

More substring practice

Getting the positioning of substring letter positions is tricky! Let's make sure we really have it nailed down.

Remember that each character in a string is numbered starting from 0. So for the word "hello", The letter h is in position 0, the letter e is in position 1, and so on.

Instructions
Using console.log, on three separate lines, print out the substrings for the following strings.

a. "Jan" in "January"
b. "Melbourne is" in "Melbourne is great" (note the space!)
c. "burgers" in "Hamburgers"


Further information available on codeacademy.com


*/