Use `substr` instead of `slice`

Just a minor change, but it saves a few bytes :)