I am amenable to any approach which does not reinvent imperative index-based string parsing.