Substrings!


#1

So, we give the number of the first letter of a particular word or phrase in a given string for the sub string.
But what if the my string has got so many words and i want something right at the end?
I can think of one possible solution.
Like this.

var z="my name is so and so";
var x="My name is so".length;
var y="My name is so and so".length;
console.log(z.substring(x,y));

Also, we can do it using prompt.
But is there any other simple solution to find it?


#2

You could do it like that

console.log("My name is so and so".substing(0,7))

#3

I get it!
What if the string is very long?
What if it's a paragraph and you want to display one of the lines?