Let's work from the outside in.
for (int i = 0; i < length - 1; i++) {
Clearly, this loop is executed $n = \mathtt{length}-1$ times, so we get $\sum_{i=0}^{n-1} \dots$ where $\dots$ stands for the time needed by the loop's body (for iteration $i$). Inside, we have
for (int j = i + 1; j < length; j++) {
which we can translate similarly, obtaining $\sum_{i=0}^{n-1} \sum_{j = i+1}^{n} \dots$. Last but not least, the innermost operation
System.out.println(input.substring(i,j));
is apparently assumed to take $j-i$ steps (one operation per character).
Putting everything together, we get
$\qquad \begin{align}
T(n) &= \sum_{i=0}^{n-1} \sum_{j = i+1}^{n} j - i \\
&= \sum_{i=0}^{n-1} \left[\left(\sum_{j = i+1}^{n} j\right) - (n-i)i\right] \\
&= \sum_{i=0}^{n-1} \left[\left(\sum_{j = 1}^{n} j - \sum_{j = 1}^{i} j\right) - (n-i)i\right] \\
&= \sum_{i=0}^{n-1} \left[\left(\frac{n(n+1)}{2} - \frac{i(i+1)}{2}\right) - (n-i)i\right] \\
&= \sum_{i=0}^{n-1} \left[ \frac{n^2 - (2i - 1)n + i^2 - i}{2}\right]
\end{align}$
The term in brackets is what you are looking for.
The whole sum can be evaluated using Gauss' formula and its sibling for summand $i^2$:
$\qquad \begin{align}
2T(n) &= \sum_{i=0}^{n-1} n^2 - \sum_{i=0}^{n-1} 2in + \sum_{i=0}^{n-1} n + \sum_{i=0}^{n-1} i^2 - \sum_{i=0}^{n-1} i \\
&= n^3 - 2n \cdot \sum_{i=0}^{n-1} i + n^2 + \sum_{i=0}^{n-1} i^2 - \sum_{i=0}^{n-1} i \\
&= n^3 - n^2(n-1) + n^2 + \frac{(n-1)n(2n - 1)}{6} - \frac{n(n-1)}{2} \\
&= \frac{12n^2 + 2n^3 - 3n^2 + n - 3n^2 + 3n}{6} \\
&= \frac{2n^3 + 6n^2 + 4n}{6}
\end{align}$
which immediately yields
$\qquad \displaystyle T(n) = \frac{n^3 + 3n^2 + 2n}{6}$.