Simple substring function using recursion.
Simple substring function using recursion.