trim leading slashes more efficiently