Q:

string substring typescript

let str = "Apples are round, and apples are juicy."; 
console.log("(1,2): "    + str.substring(1,2)); 
console.log("(0,10): "   + str.substring(0, 10)); 
console.log("(5): "      + str.substring(5));

output:

(1,2): p 
(0,10): Apples are 
(5): s are round, and apples are juicy.
1

New to Communities?

Join the community