Use String.slice instead of String.substring in order to save a three bytes. Close gh-1261.