Thanks @QiaochuYuan for giving me the answer. After thinking about it for a bit I've come to the proof:
The number of possible substrings is equal to the number of starting locations:
Possible substrings = Number of starting locations
The number of starting locations is equal to the total number of locations ($n$) minus the number of impossible starting locations.
Number of starting locations = $n$ - Number of impossible starting locations
The number of impossible starting locations is $k-1$. This is because the last possible substring occurs at the $(n-k)$th digit, because $(n-k) + k = n$, and you cannot exceed the value of $n$.
So the total number of possible substrings of length $k$ formed of consecutive characters of a string of length $n$ is:
$n - (k -1) = n - k + 1$