Return a copy of str with the given prefix removed, if present.
Declared in <util/string.h>
[[nodiscard]]
std::string
RemovePrefix(
std::string_view str,
std::string_view prefix);
A new string without the leading prefix, or a copy of str.
The return value should not be discarded.
| Name | Description |
|---|---|
| str | Input string. |
| prefix | Prefix to strip when str starts with it. |