These string manipulation problems are trivial with standard python libraries.
0.1s on first run.
0.27s on first run. Looking at the solutions people are submitting in other langues makes me really appreciate the concise way that python lets me say things.