Solution 1-8

Partial solution, makes more than 1 call to substring.