// Name not found
// Analysis
i = cookieString.indexOf(";", i);
if(i<0)
	return null;
else
	i += 2;
}

This section of code is responsible for incrementing the index variable. To increment the variable, the code uses the indexOf() method to search for the next semicolon.

If there aren't any more semicolons in the string, the code returns null and exits.

However, if a semicolon is found, the index variable is set to two characters past the semicolon. This will skip the semicolon, as well as the trailing space.

Close Window