Code is giving an error
Your star_indx variable variable is not holding the correct values. After the end of the loop, it is holding a value 256 which is giving an error with substr function.
Cross check your code with the video
Your star_indx variable variable is not holding the correct values. After the end of the loop, it is holding a value 256 which is giving an error with substr function.
Cross check your code with the video