[#absl-StripPrefix] = xref:absl.adoc[absl]::StripPrefix :relfileprefix: ../ :mrdocs: 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. == Synopsis Declared in `<absl/strings/strip.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] constexpr std::string_view StripPrefix( std::string_view str, std::string_view prefix); ---- == Return Value A view of `str` with `prefix` removed, or `str` unchanged if absent. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *str* | The input string. | *prefix* | The prefix to remove. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#