Returns a view into the input string str with the given prefix removed, but leaving the original string intact. If the prefix does not match at the start of the string, returns the original string instead.
Declared in <absl/strings/strip.h>
[[nodiscard]]
constexpr
std::string_view
StripPrefix(
std::string_view str,
std::string_view prefix);
A view of str with prefix removed, or str unchanged if absent.
The return value should not be discarded.
| Name | Description |
|---|---|
| str | The input string. |
| prefix | The prefix to remove. |