shouldn't the answers i have written (which you read) contain some of the answers?
because, i (thanks to your if condition) contains the index of the first letter of your name, so by assigning the value stored in i to j, you can now loop over your name. Now j has the index of the start of your name.
because the end of your name is at i + myName.length? this way, j has a end end a starting point, which exactly matches the position of your name