Solve Exercise 5-4: strend()

Detailed answers below the question will only occur now if I cannot
explain myself well enough in code and nearby comments. I'm looking
to learn how to write better comments so there's less need for prose.