Added a function to determine last index of a string and not only a character.