Remove every trailing / from a string.
/
A loop rather than s.replace(//+$/, ""): that regex retries from every / in a run that is not at the end, so a long run of slashes followed by anything else takes quadratic time.
s.replace(//+$/, "")
URL, path or path template
the string without trailing slashes
Remove every trailing
/from a string.A loop rather than
s.replace(//+$/, ""): that regex retries from every/in a run that is not at the end, so a long run of slashes followed by anything else takes quadratic time.