TIL Swift 5.7 have added functions trimPrefix and trimmingPrefix to collections and sequences. Documentation is incorrect so I have fixed it.