Instead of allocating a new substring at each call we can use String.startsWith()

Comment From: sbrannen

This has been merged into master.

Thanks