[#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&period; If the prefix does not match at the start of the string, returns the original string instead&period;

== Synopsis

Declared in `&lt;absl&sol;strings&sol;strip&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
std::string&lowbar;view
StripPrefix(
    std::string&lowbar;view str,
    std::string&lowbar;view prefix);
----

== Return Value

A view of `str` with `prefix` removed, or `str` unchanged if absent&period;

[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&period;
| *prefix*
| The prefix to remove&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
