std.replace_suffix()

Replaces the literal string pattern in string s with replacement, if s begins with that suffix.

This corresponds to std.suffixof(s, pattern) returning true. If pattern is the empty string, the original string s is returned.

Format

STRING
std.replace_suffix(STRING s, STRING pattern STRING replacement)

Examples

1
std.replace_suffix(req.url, "/", "")