sequence of symbols from any part of the given string over an alphabet is called a substring
for abb
0length is epsilon
1 length is a,b
2 length is ab,bb
3 length is abb
how bb can be a substring because we have skipped a
if the above case is true then prefix is almost same to substring its a sequence of beginning symbols
0 length prefix is epsilon
1 length prefix is a,(why not b here can be a prefix over here above in two length string we are skipping a and taking bb as a two length substring )