[#util-RemoveSuffixView]
= xref:util.adoc[util]::RemoveSuffixView
:relfileprefix: ../
:mrdocs:

Return a view of str with the given suffix removed, if present&period;

== Synopsis

Declared in `&lt;util&sol;string&period;h&gt;`

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

== Return Value

A view into str without the trailing suffix, or str unchanged&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *str*
| Input string&period;
| *suffix*
| Suffix to strip when str ends with it&period;
|===


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