Change the `lastString[0]` to `lastString.indexOf`