Updating substring example.

Simplifying the `range` generation.