Aswer will be D (asuming all characters in string are distinct)
Take an example String "abc"
Substrings of length 1 = {a,b,c}
Substrings of length 2 = {ab,bc}
Substrings of length 3 = {abc}
Total Substrings of non zero length will be 3+2+1 = 6
However Answer will be A, if all characters are same
consider "aaa"
Substrings of length 1 = {a}
Substrings of length 2 = {aa}
Substrings of length 3 = {aaa}
So answer can be vary from n to $\frac{n(n+1)}{2}$ if the distinct keyword is not given!!