News

Javascript string substr() method : the substr() method is used to extract the sub-string from a string. it counts the index from 0. it returns the number of characters starts from the first parameter ...
Both string methods essentially have the same functionality, which is to return a specific portion of the string variable. While reviewing JavaScript during my daily Anki spaced repetition review, my ...
The problem with your latter post is that indexOf returns (-1) when the substring is not found. <BR><BR>-1 == true<BR><BR>Instead test if the indexOf ("index2.htm") > -1.