sS dropTrailingAndLeadingSlash(S s) { if (startsWith(s, '/') && endsWith(s, '/')) ret substring(s, 1, l(s)-1); ret s; }