Sierra Digital interview question

write a program to find the length of substring