The ending index of the substring operator cannot be less than the starting index.
Make sure that the starting index is less than or equal to the ending index.