Jump to content

indexOf(),,, can u explain me what's the output exactly???


Maisara-WD

Recommended Posts

HiThis object is too strange,, can any body tell me what is the benefit we will have from this object??? I mean,, can u explain this object in details, for me please,, from the syntax to the examplethanx>>>>>>

Link to comment
Share on other sites

It's extremely simple. It will tell you the position of a string in another string:

str = "The quick brown fox jumps over the lazy dog";alert(str.indexOf("q"));

This will return 4Because "q" is 4 characters into the string:

String:   The q...Position: 01234...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...