Return a view of str with the given suffix removed, if present.
Declared in <util/string.h>
[[nodiscard]]
std::string_view
RemoveSuffixView(
std::string_view str,
std::string_view suffix);
A view into str without the trailing suffix, or str unchanged.
The return value should not be discarded.
| Name | Description |
|---|---|
| str | Input string. |
| suffix | Suffix to strip when str ends with it. |