Gabriel Ivăncescu gabrielopcode@gmail.com writes:
Scanning backwards can avoid a full scan of the entire string and makes more sense since we are looking for the last char.
It was done this way for symmetry with the other similar functions. I don't think it's necessary to change it.