The number of substrings (of all lengths inclusive) that can be formed from a character string of length $n$ is
This might help:
https://math.stackexchange.com/questions/1237097/difference-subsequences-and-substrings
Why this answer to exactly same question?
https://gateoverflow.in/87874/gate1989-4-i
Gatecse