I am getting : Start (1) + length (1) - 1 exceeds text length (0). I dont understand what i am doing wrong

Your problem is in here:

You may want to look here at some Wordle code examples